diff --git a/docs/unicodeplots_examples.md b/docs/unicodeplots_examples.md index 4423d97b..7d26696f 100644 --- a/docs/unicodeplots_examples.md +++ b/docs/unicodeplots_examples.md @@ -1,3 +1,19 @@ +# Examples for backend: unicodeplots + +- Supported arguments: args, axis, color, kwargs, label, legend, linestyle, linetype, marker, markercolor, markersize, nbins, size, title, width, windowtitle, xlabel, ylabel, yrightlabel +- Supported values for axis: [:auto,:left] +- Supported values for linetype: [:none,:line,:step,:sticks,:scatter,:heatmap,:hexbin,:hist,:bar] +- Supported values for linestyle: [:auto,:solid] +- Supported values for marker: [:none,:auto,:ellipse] +- Is `subplot`/`subplot!` supported? Yes + +### Initialize + +```julia +using Plots +unicodeplots!() +``` + ### Lines A simple line plot of the 3 columns. @@ -10,7 +26,7 @@ plot(rand(100,3)) ### Functions -Plot multiple functions. +Plot multiple functions. You can also put the function first. ```julia plot(0:0.01:4π,[sin,cos]) @@ -30,7 +46,7 @@ plot([sin,cos],0,4π) ### -Or make a parametric plot with plot(fx, fy, umin, umax). +Or make a parametric plot (i.e. plot: (fx(u), fy(u))) with plot(fx, fy, umin, umax). ```julia plot(sin,(x->begin # /Users/tom/.julia/v0.4/Plots/docs/example_generation.jl, line 33: @@ -54,7 +70,7 @@ plot(rand(10); title="TITLE",xlabel="XLABEL",ylabel="YLABEL",background_color=RG Use the `axis` or `axiss` arguments. -Note: This is only supported with Qwt right now +Note: Currently only supported with Qwt and PyPlot ```julia plot(Vector[randn(100),randn(100) * 100]; axiss=[:left,:right],ylabel="LEFT",yrightlabel="RIGHT") @@ -92,35 +108,38 @@ scatter!(rand(100); markersize=6,color=:blue) ![](../img/unicodeplots/unicodeplots_example_9.png) -### Lots of line types +### Suported line types -Options: (:line, :step, :stepinverted, :sticks, :scatter, :none, :heatmap, :hexbin, :hist, :bar) -Note: some may not work with all backends +All options: (:line, :orderedline, :step, :stepinverted, :sticks, :scatter, :none, :heatmap, :hexbin, :hist, :bar) ```julia -plot(rand(20,4); linetypes=[:line,:step,:sticks,:scatter],labels=["line","step","sticks","dots"]) +types = intersect(supportedTypes(),[:line,:step,:stepinverted,:sticks,:scatter]) +n = length(types) +x = Vector[sort(rand(20)) for i = 1:n] +y = rand(20,n) +plot(x,y; linetypes=types,labels=map(string,types)) ``` ![](../img/unicodeplots/unicodeplots_example_11.png) -### Lots of line styles +### Supported line styles -Options: (:solid, :dash, :dot, :dashdot, :dashdotdot) -Note: some may not work with all backends +All options: (:solid, :dash, :dot, :dashdot, :dashdotdot) ```julia -plot(rand(20,5); linestyles=[:solid,:dash,:dot,:dashdot,:dashdotdot],labels=["solid","dash","dot","dashdot","dashdotdot"]) +styles = setdiff(supportedStyles(),[:auto]) +plot(rand(20,length(styles)); linestyle=:auto,labels=map(string,styles)) ``` ![](../img/unicodeplots/unicodeplots_example_12.png) -### Lots of marker types +### Supported marker types -Options: (:none, :ellipse, :rect, :diamond, :utriangle, :dtriangle, :cross, :xcross, :star1, :star2, :hexagon) -Note: some may not work with all backends +All options: (:none, :auto, :ellipse, :rect, :diamond, :utriangle, :dtriangle, :cross, :xcross, :star1, :star2, :hexagon) ```julia -plot(repmat(collect(1:10)',10,1); markers=[:ellipse,:rect,:diamond,:utriangle,:dtriangle,:cross,:xcross,:star1,:star2,:hexagon],labels=["ellipse","rect","diamond","utriangle","dtriangle","cross","xcross","star1","star2","hexagon"],markersize=10) +markers = setdiff(supportedMarkers(),[:none,:auto]) +plot([fill(i,10) for i = 1:length(markers)]; marker=:auto,labels=map(string,markers),markersize=10) ``` ![](../img/unicodeplots/unicodeplots_example_13.png) diff --git a/img/unicodeplots/unicodeplots_example_1.png b/img/unicodeplots/unicodeplots_example_1.png index a974c149..31acf48c 100644 Binary files a/img/unicodeplots/unicodeplots_example_1.png and b/img/unicodeplots/unicodeplots_example_1.png differ diff --git a/img/unicodeplots/unicodeplots_example_11.png b/img/unicodeplots/unicodeplots_example_11.png index 8379c1a7..caf2787c 100644 Binary files a/img/unicodeplots/unicodeplots_example_11.png and b/img/unicodeplots/unicodeplots_example_11.png differ diff --git a/img/unicodeplots/unicodeplots_example_12.png b/img/unicodeplots/unicodeplots_example_12.png index 5a048b28..25895e1b 100644 Binary files a/img/unicodeplots/unicodeplots_example_12.png and b/img/unicodeplots/unicodeplots_example_12.png differ diff --git a/img/unicodeplots/unicodeplots_example_13.png b/img/unicodeplots/unicodeplots_example_13.png index 71c5c639..a8247f7f 100644 Binary files a/img/unicodeplots/unicodeplots_example_13.png and b/img/unicodeplots/unicodeplots_example_13.png differ diff --git a/img/unicodeplots/unicodeplots_example_14.png b/img/unicodeplots/unicodeplots_example_14.png index ef582255..967042d2 100644 Binary files a/img/unicodeplots/unicodeplots_example_14.png and b/img/unicodeplots/unicodeplots_example_14.png differ diff --git a/img/unicodeplots/unicodeplots_example_15.png b/img/unicodeplots/unicodeplots_example_15.png index 19677668..0cb2a6c8 100644 Binary files a/img/unicodeplots/unicodeplots_example_15.png and b/img/unicodeplots/unicodeplots_example_15.png differ diff --git a/img/unicodeplots/unicodeplots_example_16.png b/img/unicodeplots/unicodeplots_example_16.png index 9baee15b..2d848d15 100644 Binary files a/img/unicodeplots/unicodeplots_example_16.png and b/img/unicodeplots/unicodeplots_example_16.png differ diff --git a/img/unicodeplots/unicodeplots_example_17.png b/img/unicodeplots/unicodeplots_example_17.png index 1076b727..d7f510e0 100644 Binary files a/img/unicodeplots/unicodeplots_example_17.png and b/img/unicodeplots/unicodeplots_example_17.png differ diff --git a/img/unicodeplots/unicodeplots_example_18.png b/img/unicodeplots/unicodeplots_example_18.png index 2971756d..c1d10ee2 100644 Binary files a/img/unicodeplots/unicodeplots_example_18.png and b/img/unicodeplots/unicodeplots_example_18.png differ diff --git a/img/unicodeplots/unicodeplots_example_5.png b/img/unicodeplots/unicodeplots_example_5.png index 2878bef0..169d47d2 100644 Binary files a/img/unicodeplots/unicodeplots_example_5.png and b/img/unicodeplots/unicodeplots_example_5.png differ diff --git a/img/unicodeplots/unicodeplots_example_6.png b/img/unicodeplots/unicodeplots_example_6.png index 622a90f0..12320d41 100644 Binary files a/img/unicodeplots/unicodeplots_example_6.png and b/img/unicodeplots/unicodeplots_example_6.png differ diff --git a/img/unicodeplots/unicodeplots_example_7.png b/img/unicodeplots/unicodeplots_example_7.png index 87eb6d90..2427b95b 100644 Binary files a/img/unicodeplots/unicodeplots_example_7.png and b/img/unicodeplots/unicodeplots_example_7.png differ diff --git a/img/unicodeplots/unicodeplots_example_8.png b/img/unicodeplots/unicodeplots_example_8.png index f06e56bd..79d652b0 100644 Binary files a/img/unicodeplots/unicodeplots_example_8.png and b/img/unicodeplots/unicodeplots_example_8.png differ diff --git a/img/unicodeplots/unicodeplots_example_9.png b/img/unicodeplots/unicodeplots_example_9.png index e2ba4d14..3e8f7811 100644 Binary files a/img/unicodeplots/unicodeplots_example_9.png and b/img/unicodeplots/unicodeplots_example_9.png differ diff --git a/src/backends/gadfly.jl b/src/backends/gadfly.jl index 23e622ff..6e98e269 100644 --- a/src/backends/gadfly.jl +++ b/src/backends/gadfly.jl @@ -6,7 +6,7 @@ immutable GadflyPackage <: PlottingPackage end gadfly!() = plotter!(:gadfly) -supportedArgs(::GadflyPackage) = setdiff(ALL_ARGS, [:heatmap_c, :fillto, :pos]) +supportedArgs(::GadflyPackage) = setdiff(ARGS, [:heatmap_c, :fillto, :pos]) supportedAxes(::GadflyPackage) = setdiff(ALL_AXES, [:right]) supportedTypes(::GadflyPackage) = setdiff(TYPES, [:stepinverted]) supportedStyles(::GadflyPackage) = [:auto, :solid] diff --git a/src/backends/pyplot.jl b/src/backends/pyplot.jl index 442e5a09..dfa8d441 100644 --- a/src/backends/pyplot.jl +++ b/src/backends/pyplot.jl @@ -7,7 +7,7 @@ pyplot!() = plotter!(:pyplot) # ------------------------------- -supportedArgs(::PyPlotPackage) = setdiff(ALL_ARGS, [:reg, :heatmap_c, :fillto, :pos]) +supportedArgs(::PyPlotPackage) = setdiff(ARGS, [:reg, :heatmap_c, :fillto, :pos]) # supportedAxes(::PyPlotPackage) = [:left] # supportedTypes(::PyPlotPackage) = setdiff(TYPES, [:stepinverted]) supportedStyles(::PyPlotPackage) = setdiff(ALL_STYLES, [:dashdotdot]) diff --git a/src/backends/unicodeplots.jl b/src/backends/unicodeplots.jl index 77675781..93609675 100644 --- a/src/backends/unicodeplots.jl +++ b/src/backends/unicodeplots.jl @@ -7,7 +7,7 @@ unicodeplots!() = plotter!(:unicodeplots) # ------------------------------- -supportedArgs(::UnicodePlotsPackage) = setdiff(ALL_ARGS, [:reg, :heatmap_c, :fillto, :pos]) +supportedArgs(::UnicodePlotsPackage) = setdiff(ARGS, [:reg, :heatmap_c, :fillto, :pos]) supportedAxes(::UnicodePlotsPackage) = [:auto, :left] supportedTypes(::UnicodePlotsPackage) = setdiff(ALL_TYPES, [:stepinverted]) supportedStyles(::UnicodePlotsPackage) = [:auto, :solid]