Plots.jl/examples/iris.ipynb
2015-09-24 00:35:18 -04:00

140 lines
2.5 KiB
Plaintext

{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"using RDatasets, Plots; dataframes!()\n",
"iris = dataset(\"datasets\", \"iris\");\n",
"plotDefault!(:size, (600,400));"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false,
"scrolled": false
},
"outputs": [],
"source": [
"gadfly!();\n",
"scatter(iris, :SepalLength, :SepalWidth, group=:Species, ms=12, m=[:+,:h,:s])"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false,
"scrolled": false
},
"outputs": [],
"source": [
"\n",
"plot!(u->6+2*sin(u), u->3+cos(u), 0, 2π, lab=\"an oval\", fill=3)\n",
"plot!(Any[[6],[3]], t=[:vline,:hline], w=4, c=RGB(1,0,0))\n",
"title!(\"Playing around with series\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"scatter(iris, :SepalLength, [:PetalLength,:PetalWidth,:SepalWidth], m=:auto, ms=10, gui=false)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"species = iris[:Species]\n",
"split(species)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"using StatsBase\n",
"methods(svd)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"arr = Array(iris[[:SepalLength,:SepalWidth]])\n",
"pca(arr)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"Pkg.update()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false,
"scrolled": false
},
"outputs": [],
"source": [
"scatter([0,0],ms=40,m=:s)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Julia 0.4.0-rc2",
"language": "julia",
"name": "julia-0.4"
},
"language_info": {
"file_extension": ".jl",
"mimetype": "application/julia",
"name": "julia",
"version": "0.4.0"
}
},
"nbformat": 4,
"nbformat_minor": 0
}