winston examples
@ -1,11 +1,4 @@
|
|||||||
# Examples for backend: winston
|
## 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
|
|
||||||
|
|
||||||
### Initialize
|
### Initialize
|
||||||
|
|
||||||
@ -24,22 +17,12 @@ plot(fakedata(50,5),w=3)
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
### 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
|
```julia
|
||||||
plot(0:0.01:4π,[sin,cos])
|
plot(sin,(x->begin # /Users/tom/.julia/v0.4/Plots/docs/example_generation.jl, line 50:
|
||||||
```
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
###
|
|
||||||
|
|
||||||
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:
|
|
||||||
sin(2x)
|
sin(2x)
|
||||||
end),0,2π,line=4,leg=false,fill=(0,:orange))
|
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!`
|
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
|
```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)
|
||||||
```
|
```
|
||||||
|
|
||||||

|

|
||||||
@ -75,7 +60,7 @@ Use the `axis` arguments.
|
|||||||
Note: Currently only supported with Qwt and PyPlot
|
Note: Currently only supported with Qwt and PyPlot
|
||||||
|
|
||||||
```julia
|
```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")
|
||||||
```
|
```
|
||||||
|
|
||||||

|

|
||||||
@ -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.
|
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
|
```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]))
|
||||||
```
|
```
|
||||||
|
|
||||||

|

|
||||||
@ -130,7 +115,7 @@ plot(x,y,line=(types,3),lab=map(string,types),ms=15)
|
|||||||
|
|
||||||
```julia
|
```julia
|
||||||
styles = setdiff(supportedStyles(),[:auto])'
|
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)
|
||||||
```
|
```
|
||||||
|
|
||||||

|

|
||||||
@ -140,8 +125,11 @@ plot(cumsum(randn(20,length(styles)),1); style=:auto,label=map(string,styles),w=
|
|||||||
|
|
||||||
|
|
||||||
```julia
|
```julia
|
||||||
markers = setdiff(supportedMarkers(),[:none,:auto])'
|
markers = setdiff(supportedMarkers(),[:none,:auto,Shape])'
|
||||||
scatter(0.5:9.5,[fill(i - 0.5,10) for i = length(markers):-1:1]; marker=:auto,label=map(string,markers),ms=12)
|
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)
|
||||||
```
|
```
|
||||||
|
|
||||||

|

|
||||||
@ -166,15 +154,11 @@ histogram(randn(1000),nbins=50)
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
### Annotations
|
- 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`
|
||||||
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)`
|
- Supported values for linetype: `:bar`, `:hist`, `:line`, `:none`, `:path`, `:scatter`, `:sticks`
|
||||||
|
- Supported values for linestyle: `:auto`, `:dash`, `:dashdot`, `:dot`, `:solid`
|
||||||
```julia
|
- Supported values for marker: `:auto`, `:cross`, `:diamond`, `:dtriangle`, `:ellipse`, `:none`, `:rect`, `:star5`, `:utriangle`, `:xcross`
|
||||||
y = rand(10)
|
- Is `subplot`/`subplot!` supported? No
|
||||||
plot(y,ann=(3,y[3],"this is #3"))
|
|
||||||
annotate!([(5,y[5],"this is #5"),(9,y[10],"this is #10")])
|
|
||||||
```
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
|
(Automatically generated: 2015-10-18T00:50:13)
|
||||||
|
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 37 KiB |
|
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 42 KiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 23 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 7.0 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 47 KiB After Width: | Height: | Size: 48 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 33 KiB |