diff --git a/README.md b/README.md index 0f630a44..aa38634d 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Plots is a plotting API and toolset. My goals with the package are: -- **Intuitive** Start generating complex plots without reading volumes of documentation. Commands should "just work". +- **Intuitive**. Start generating complex plots without reading volumes of documentation. Commands should "just work". - **Concise**. Less code means fewer mistakes and more efficient development/analysis. - **Flexible**. Produce your favorite plots from your favorite package, but quicker and simpler. - **Consistent**. Don't commit to one graphics package. Use the same code and access the strengths of all backends. diff --git a/docs/example_generation.jl b/docs/example_generation.jl index 3cd84610..1dc658d9 100644 --- a/docs/example_generation.jl +++ b/docs/example_generation.jl @@ -35,7 +35,7 @@ const examples = PlotExample[ :(plot(fakedata(50,5), w=3)) ]), PlotExample("Functions, adding data, and animations", - "Plot multiple functions. You can also put the function first, or use the form `plot(f, xmin, xmax)` where f is a Function or AbstractVector{Function}. Set, get, and push/append to series data, and easily build animations.\n\nNote: ImageMagick's `convert` or `ffmpeg` must be runnable from pwd to generate the animation. Use command `gif(anim, filename, fps=15)` to save the animation.", + "Plot multiple functions. You can also put the function first, or use the form `plot(f, xmin, xmax)` where f is a Function or AbstractVector{Function}.\n\nGet series data: `x, y = plt[i]`. Set series data: `plt[i] = (x,y)`. Add to the series with `push!`/`append!`.\n\nEasily build animations. (`convert` or `ffmpeg` must be available to generate the animation.) Use command `gif(anim, filename, fps=15)` to save the animation.", [ :(p = plot([sin,cos], zeros(0), leg=false)), :(anim = Animation()), @@ -44,8 +44,8 @@ const examples = PlotExample[ frame(anim) end) ]), - PlotExample("", - "Or make a parametric plot (i.e. plot: (fx(u), fy(u))) with plot(fx, fy, umin, umax).", + PlotExample("Parametric plots", + "Plot function pair (x(u), y(u)).", [ :(plot(sin, x->sin(2x), 0, 2π, line=4, leg=false, fill=(0,:orange))) ]), @@ -177,7 +177,7 @@ const examples = PlotExample[ function createStringOfMarkDownCodeValues(arr, prefix = "") - string("`", prefix, join(arr, "`, `$prefix"), "`") + string("`", prefix, join(sort(map(string, arr)), "`, `$prefix"), "`") end createStringOfMarkDownSymbols(arr) = isempty(arr) ? "" : createStringOfMarkDownCodeValues(arr, ":") @@ -196,13 +196,7 @@ function generate_markdown(pkgname::Symbol) # open the markdown file md = open("$DOCDIR/$(pkgname)_examples.md", "w") - write(md, "# Examples for backend: $pkgname (generated $(now()))\n\n") - write(md, "- Supported arguments: $(createStringOfMarkDownCodeValues(supportedArgs(pkg)))\n") - write(md, "- Supported values for axis: $(createStringOfMarkDownSymbols(supportedAxes(pkg)))\n") - write(md, "- Supported values for linetype: $(createStringOfMarkDownSymbols(supportedTypes(pkg)))\n") - write(md, "- Supported values for linestyle: $(createStringOfMarkDownSymbols(supportedStyles(pkg)))\n") - write(md, "- Supported values for marker: $(createStringOfMarkDownSymbols(supportedMarkers(pkg)))\n") - write(md, "- Is `subplot`/`subplot!` supported? $(subplotSupported(pkg) ? "Yes" : "No")\n\n") + write(md, "## Examples for backend: $pkgname\n(generated $(now()))\n\n") write(md, "### Initialize\n\n```julia\nusing Plots\n$(pkgname)()\n```\n\n") @@ -243,6 +237,13 @@ function generate_markdown(pkgname::Symbol) # end + write(md, "- Supported arguments: $(createStringOfMarkDownCodeValues(supportedArgs(pkg)))\n") + write(md, "- Supported values for axis: $(createStringOfMarkDownSymbols(supportedAxes(pkg)))\n") + write(md, "- Supported values for linetype: $(createStringOfMarkDownSymbols(supportedTypes(pkg)))\n") + write(md, "- Supported values for linestyle: $(createStringOfMarkDownSymbols(supportedStyles(pkg)))\n") + write(md, "- Supported values for marker: $(createStringOfMarkDownSymbols(supportedMarkers(pkg)))\n") + write(md, "- Is `subplot`/`subplot!` supported? $(subplotSupported(pkg) ? "Yes" : "No")\n\n") + close(md) end diff --git a/docs/gadfly_examples.md b/docs/gadfly_examples.md index 0130f2a4..736febad 100644 --- a/docs/gadfly_examples.md +++ b/docs/gadfly_examples.md @@ -1,11 +1,5 @@ -# Examples for backend: gadfly (generated 2015-10-17T23:09:16) - -- Supported arguments: `annotation`, `background_color`, `color`, `color_palette`, `fillrange`, `fillcolor`, `fillopacity`, `foreground_color`, `group`, `label`, `layout`, `legend`, `linestyle`, `linetype`, `linewidth`, `lineopacity`, `markershape`, `markercolor`, `markersize`, `markeropacity`, `n`, `nbins`, `nc`, `nr`, `smooth`, `show`, `size`, `title`, `windowtitle`, `x`, `xlabel`, `xlims`, `xticks`, `y`, `ylabel`, `ylims`, `yticks`, `xscale`, `yscale`, `xflip`, `yflip`, `z`, `tickfont`, `guidefont`, `legendfont`, `grid` -- Supported values for axis: `:auto`, `:left` -- Supported values for linetype: `:none`, `:line`, `:path`, `:steppre`, `:steppost`, `:sticks`, `:scatter`, `:heatmap`, `:hexbin`, `:hist`, `:bar`, `:hline`, `:vline`, `:ohlc` -- Supported values for linestyle: `:auto`, `:solid`, `:dash`, `:dot`, `:dashdot`, `:dashdotdot` -- Supported values for marker: `:none`, `:auto`, `:cross`, `:diamond`, `:dtriangle`, `:ellipse`, `:heptagon`, `:hexagon`, `:octagon`, `:pentagon`, `:rect`, `:star4`, `:star5`, `:star6`, `:star7`, `:star8`, `:utriangle`, `:xcross`, `:Plots.Shape` -- Is `subplot`/`subplot!` supported? Yes +## Examples for backend: gadfly +(generated 2015-10-17T23:27:21) ### Initialize @@ -26,9 +20,11 @@ plot(fakedata(50,5),w=3) ### Functions, adding data, and animations -Plot multiple functions. You can also put the function first, or use the form `plot(f, xmin, xmax)` where f is a Function or AbstractVector{Function}. Set, get, and push/append to series data, and easily build animations. +Plot multiple functions. You can also put the function first, or use the form `plot(f, xmin, xmax)` where f is a Function or AbstractVector{Function}. -Note: ImageMagick's `convert` or `ffmpeg` must be runnable from pwd to generate the animation. Use command `gif(anim, filename, fps=15)` to save the animation. +Get series data: `x, y = plt[i]`. Set series data: `plt[i] = (x,y)`. Add to the series with `push!`/`append!`. + +Easily build animations. (`convert` or `ffmpeg` must be available to generate the animation.) Use command `gif(anim, filename, fps=15)` to save the animation. ```julia p = plot([sin,cos],zeros(0),leg=false) @@ -41,9 +37,9 @@ end ![](../img/gadfly/gadfly_example_2.gif) -### +### Parametric plots -Or make a parametric plot (i.e. plot: (fx(u), fy(u))) with plot(fx, fy, umin, umax). +Plot function pair (x(u), y(u)). ```julia plot(sin,(x->begin # /Users/tom/.julia/v0.4/Plots/docs/example_generation.jl, line 50: @@ -244,3 +240,10 @@ plot(0.1:0.2:0.9,0.7 * rand(5) + 0.15,l=(3,:dash,:lightblue),m=(Shape(verts),30, ![](../img/gadfly/gadfly_example_21.png) +- Supported arguments: `annotation`, `background_color`, `color`, `color_palette`, `fillcolor`, `fillopacity`, `fillrange`, `foreground_color`, `grid`, `group`, `guidefont`, `label`, `layout`, `legend`, `legendfont`, `lineopacity`, `linestyle`, `linetype`, `linewidth`, `markercolor`, `markeropacity`, `markershape`, `markersize`, `n`, `nbins`, `nc`, `nr`, `show`, `size`, `smooth`, `tickfont`, `title`, `windowtitle`, `x`, `xflip`, `xlabel`, `xlims`, `xscale`, `xticks`, `y`, `yflip`, `ylabel`, `ylims`, `yscale`, `yticks`, `z` +- Supported values for axis: `:auto`, `:left` +- Supported values for linetype: `:bar`, `:heatmap`, `:hexbin`, `:hist`, `:hline`, `:line`, `:none`, `:ohlc`, `:path`, `:scatter`, `:steppost`, `:steppre`, `:sticks`, `:vline` +- Supported values for linestyle: `:auto`, `:dash`, `:dashdot`, `:dashdotdot`, `:dot`, `:solid` +- Supported values for marker: `:Plots.Shape`, `:auto`, `:cross`, `:diamond`, `:dtriangle`, `:ellipse`, `:heptagon`, `:hexagon`, `:none`, `:octagon`, `:pentagon`, `:rect`, `:star4`, `:star5`, `:star6`, `:star7`, `:star8`, `:utriangle`, `:xcross` +- Is `subplot`/`subplot!` supported? Yes + diff --git a/docs/readme_template.md b/docs/readme_template.md index 3e0c3d23..f56fe741 100644 --- a/docs/readme_template.md +++ b/docs/readme_template.md @@ -9,7 +9,7 @@ Plots is a plotting API and toolset. My goals with the package are: -- **Intuitive** Start generating complex plots without reading volumes of documentation. Commands should "just work". +- **Intuitive**. Start generating complex plots without reading volumes of documentation. Commands should "just work". - **Concise**. Less code means fewer mistakes and more efficient development/analysis. - **Flexible**. Produce your favorite plots from your favorite package, but quicker and simpler. - **Consistent**. Don't commit to one graphics package. Use the same code and access the strengths of all backends. diff --git a/img/gadfly/gadfly_example_4.png b/img/gadfly/gadfly_example_4.png index 8c009e2d..3cbbd025 100644 Binary files a/img/gadfly/gadfly_example_4.png and b/img/gadfly/gadfly_example_4.png differ diff --git a/img/gadfly/gadfly_example_8.png b/img/gadfly/gadfly_example_8.png index 5aef464b..4ab2cfe0 100644 Binary files a/img/gadfly/gadfly_example_8.png and b/img/gadfly/gadfly_example_8.png differ diff --git a/img/gadfly/gadfly_example_9.png b/img/gadfly/gadfly_example_9.png index e77c8ae9..69df0ce7 100644 Binary files a/img/gadfly/gadfly_example_9.png and b/img/gadfly/gadfly_example_9.png differ