diff --git a/docs/winston_examples.md b/docs/winston_examples.md index e31cb39c..1c4babd4 100644 --- a/docs/winston_examples.md +++ b/docs/winston_examples.md @@ -1,11 +1,4 @@ -# Examples for backend: winston - -- Supported arguments: `annotation`, `color`, `color_palette`, `fillrange`, `fillcolor`, `group`, `label`, `legend`, `linestyle`, `linetype`, `linewidth`, `markershape`, `markercolor`, `markersize`, `nbins`, `reg`, `show`, `size`, `title`, `windowtitle`, `x`, `xlabel`, `xlims`, `y`, `ylabel`, `ylims`, `xscale`, `yscale` -- Supported values for axis: `:auto`, `:left` -- Supported values for linetype: `:none`, `:line`, `:path`, `:sticks`, `:scatter`, `:hist`, `:bar` -- Supported values for linestyle: `:auto`, `:solid`, `:dash`, `:dot`, `:dashdot` -- Supported values for marker: `:none`, `:auto`, `:rect`, `:ellipse`, `:diamond`, `:utriangle`, `:dtriangle`, `:cross`, `:xcross`, `:star1` -- Is `subplot`/`subplot!` supported? No +## Examples for backend: winston ### Initialize @@ -24,22 +17,12 @@ plot(fakedata(50,5),w=3) ![](../img/winston/winston_example_1.png) -### Functions +### Parametric plots -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}. +Plot function pair (x(u), y(u)). ```julia -plot(0:0.01:4π,[sin,cos]) -``` - -![](../img/winston/winston_example_2.png) - -### - -Or make a parametric plot (i.e. plot: (fx(u), fy(u))) with plot(fx, fy, umin, umax). - -```julia -plot(sin,(x->begin # /home/tom/.julia/v0.4/Plots/docs/example_generation.jl, line 39: +plot(sin,(x->begin # /Users/tom/.julia/v0.4/Plots/docs/example_generation.jl, line 50: sin(2x) end),0,2π,line=4,leg=false,fill=(0,:orange)) ``` @@ -63,7 +46,9 @@ scatter!(y,z=abs(y - 0.5),m=(10,:heat),lab="grad") Change the guides/background/limits/ticks. Convenience args `xaxis` and `yaxis` allow you to pass a tuple or value which will be mapped to the relevant args automatically. The `xaxis` below will be replaced with `xlabel` and `xlims` args automatically during the preprocessing step. You can also use shorthand functions: `title!`, `xaxis!`, `yaxis!`, `xlabel!`, `ylabel!`, `xlims!`, `ylims!`, `xticks!`, `yticks!` ```julia -plot(rand(20,3),title="TITLE",xaxis=("XLABEL",(-5,30),0:2:20,:flip),yaxis=("YLABEL",:log10),background_color=RGB(0.2,0.2,0.2),leg=false) +plot(rand(20,3),xaxis=("XLABEL",(-5,30),0:2:20,:flip),background_color=RGB(0.2,0.2,0.2),leg=false) +title!("TITLE") +yaxis!("YLABEL",:log10) ``` ![](../img/winston/winston_example_5.png) @@ -75,7 +60,7 @@ Use the `axis` arguments. Note: Currently only supported with Qwt and PyPlot ```julia -plot(Vector[randn(100),randn(100) * 100]; axis=[:l :r],ylabel="LEFT",yrightlabel="RIGHT") +plot(Vector[randn(100),randn(100) * 100],axis=[:l :r],ylabel="LEFT",yrightlabel="RIGHT") ``` ![](../img/winston/winston_example_6.png) @@ -85,7 +70,7 @@ plot(Vector[randn(100),randn(100) * 100]; axis=[:l :r],ylabel="LEFT",yrightlabel Plot multiple series with different numbers of points. Mix arguments that apply to all series (marker/markersize) with arguments unique to each series (colors). Special arguments `line`, `marker`, and `fill` will automatically figure out what arguments to set (for example, we are setting the `linestyle`, `linewidth`, and `color` arguments with `line`.) Note that we pass a matrix of colors, and this applies the colors to each series. ```julia -plot(Vector[rand(10),rand(20)]; marker=(:ellipse,8),line=(:dot,3,[:black :orange])) +plot(Vector[rand(10),rand(20)],marker=(:ellipse,8),line=(:dot,3,[:black :orange])) ``` ![](../img/winston/winston_example_7.png) @@ -130,7 +115,7 @@ plot(x,y,line=(types,3),lab=map(string,types),ms=15) ```julia styles = setdiff(supportedStyles(),[:auto])' -plot(cumsum(randn(20,length(styles)),1); style=:auto,label=map(string,styles),w=5) +plot(cumsum(randn(20,length(styles)),1),style=:auto,label=map(string,styles),w=5) ``` ![](../img/winston/winston_example_12.png) @@ -140,8 +125,11 @@ plot(cumsum(randn(20,length(styles)),1); style=:auto,label=map(string,styles),w= ```julia -markers = setdiff(supportedMarkers(),[:none,:auto])' -scatter(0.5:9.5,[fill(i - 0.5,10) for i = length(markers):-1:1]; marker=:auto,label=map(string,markers),ms=12) +markers = setdiff(supportedMarkers(),[:none,:auto,Shape])' +n = length(markers) +x = (linspace(0,10,n + 2))[2:end - 1] +y = repmat(reverse(x)',n,1) +scatter(x,y,m=(8,:auto),lab=map(string,markers),bg=:linen) ``` ![](../img/winston/winston_example_13.png) @@ -166,15 +154,11 @@ histogram(randn(1000),nbins=50) ![](../img/winston/winston_example_15.png) -### Annotations - -Currently only text annotations are supported. Pass in a tuple or vector-of-tuples: (x,y,text). `annotate!(ann)` is shorthand for `plot!(; annotation=ann)` - -```julia -y = rand(10) -plot(y,ann=(3,y[3],"this is #3")) -annotate!([(5,y[5],"this is #5"),(9,y[10],"this is #10")]) -``` - -![](../img/winston/winston_example_20.png) +- Supported arguments: `annotation`, `color`, `color_palette`, `fillcolor`, `fillrange`, `group`, `label`, `legend`, `linestyle`, `linetype`, `linewidth`, `markercolor`, `markershape`, `markersize`, `nbins`, `show`, `size`, `smooth`, `title`, `windowtitle`, `x`, `xlabel`, `xlims`, `xscale`, `y`, `ylabel`, `ylims`, `yscale` +- Supported values for axis: `:auto`, `:left` +- Supported values for linetype: `:bar`, `:hist`, `:line`, `:none`, `:path`, `:scatter`, `:sticks` +- Supported values for linestyle: `:auto`, `:dash`, `:dashdot`, `:dot`, `:solid` +- Supported values for marker: `:auto`, `:cross`, `:diamond`, `:dtriangle`, `:ellipse`, `:none`, `:rect`, `:star5`, `:utriangle`, `:xcross` +- Is `subplot`/`subplot!` supported? No +(Automatically generated: 2015-10-18T00:50:13) \ No newline at end of file diff --git a/img/winston/winston_example_1.png b/img/winston/winston_example_1.png index 00f02402..09bb6b8d 100644 Binary files a/img/winston/winston_example_1.png and b/img/winston/winston_example_1.png differ diff --git a/img/winston/winston_example_11.png b/img/winston/winston_example_11.png index c30b49e7..7a70351c 100644 Binary files a/img/winston/winston_example_11.png and b/img/winston/winston_example_11.png differ diff --git a/img/winston/winston_example_12.png b/img/winston/winston_example_12.png index 1bb92879..dea3b471 100644 Binary files a/img/winston/winston_example_12.png and b/img/winston/winston_example_12.png differ diff --git a/img/winston/winston_example_13.png b/img/winston/winston_example_13.png index 26ff68df..d57416fa 100644 Binary files a/img/winston/winston_example_13.png and b/img/winston/winston_example_13.png differ diff --git a/img/winston/winston_example_14.png b/img/winston/winston_example_14.png index 1033d496..ba8ed825 100644 Binary files a/img/winston/winston_example_14.png and b/img/winston/winston_example_14.png differ diff --git a/img/winston/winston_example_15.png b/img/winston/winston_example_15.png index 8a2c3742..c1e42507 100644 Binary files a/img/winston/winston_example_15.png and b/img/winston/winston_example_15.png differ diff --git a/img/winston/winston_example_3.png b/img/winston/winston_example_3.png index a8e91248..2cd1292a 100644 Binary files a/img/winston/winston_example_3.png and b/img/winston/winston_example_3.png differ diff --git a/img/winston/winston_example_4.png b/img/winston/winston_example_4.png index bdcbe434..86464596 100644 Binary files a/img/winston/winston_example_4.png and b/img/winston/winston_example_4.png differ diff --git a/img/winston/winston_example_5.png b/img/winston/winston_example_5.png index 3415ac7b..a5698cf9 100644 Binary files a/img/winston/winston_example_5.png and b/img/winston/winston_example_5.png differ diff --git a/img/winston/winston_example_6.png b/img/winston/winston_example_6.png index 2e3a3890..00fe5373 100644 Binary files a/img/winston/winston_example_6.png and b/img/winston/winston_example_6.png differ diff --git a/img/winston/winston_example_7.png b/img/winston/winston_example_7.png index 3f1271de..ab6f6b9d 100644 Binary files a/img/winston/winston_example_7.png and b/img/winston/winston_example_7.png differ diff --git a/img/winston/winston_example_8.png b/img/winston/winston_example_8.png index 3e7c5f84..35ca5e8a 100644 Binary files a/img/winston/winston_example_8.png and b/img/winston/winston_example_8.png differ diff --git a/img/winston/winston_example_9.png b/img/winston/winston_example_9.png index cdfa12e2..9c16b904 100644 Binary files a/img/winston/winston_example_9.png and b/img/winston/winston_example_9.png differ