examples, fixes, and reorg img dir
@ -81,6 +81,11 @@ function generate_markdown(pkgname::Symbol)
|
||||
plotter!(pkgname)
|
||||
plotDefault!(:show, false)
|
||||
|
||||
# mkdir if necessary
|
||||
try
|
||||
mkdir("$IMGDIR/$pkgname")
|
||||
end
|
||||
|
||||
# open the markdown file
|
||||
md = open("$DOCDIR/$(pkgname)_examples.md", "w")
|
||||
|
||||
@ -93,13 +98,13 @@ function generate_markdown(pkgname::Symbol)
|
||||
|
||||
# save the png
|
||||
imgname = "$(pkgname)_example_$i.png"
|
||||
savepng("$IMGDIR/$imgname")
|
||||
savepng("$IMGDIR/$pkgname/$imgname")
|
||||
|
||||
# write out the header, description, code block, and image link
|
||||
write(md, "### $(example.header)\n\n")
|
||||
write(md, "$(example.desc)\n\n")
|
||||
write(md, "```julia\n$(join(map(string, example.exprs), "\n"))\n```\n\n")
|
||||
write(md, "\n\n")
|
||||
write(md, "\n\n")
|
||||
|
||||
catch ex
|
||||
# TODO: put error info into markdown?
|
||||
@ -114,8 +119,10 @@ function generate_markdown(pkgname::Symbol)
|
||||
end
|
||||
|
||||
# run it!
|
||||
# map(generate_markdown, (:qwt, :gadfly))
|
||||
generate_markdown(:unicodeplots) # generate separately so it's easy to comment out
|
||||
# note: generate separately so it's easy to comment out
|
||||
# generate_markdown(:qwt)
|
||||
generate_markdown(:gadfly)
|
||||
# generate_markdown(:unicodeplots)
|
||||
|
||||
|
||||
end # module
|
||||
|
||||
@ -1,3 +1,151 @@
|
||||
### Lines
|
||||
|
||||
A simple line plot of the 3 columns.
|
||||
|
||||
```julia
|
||||
plot(rand(100,3))
|
||||
```
|
||||
|
||||

|
||||
|
||||
### Functions
|
||||
|
||||
Plot multiple functions.
|
||||
|
||||
```julia
|
||||
plot(0:0.01:4π,[sin,cos])
|
||||
```
|
||||
|
||||

|
||||
|
||||
###
|
||||
|
||||
You can also call it with (xmin, xmax).
|
||||
|
||||
```julia
|
||||
plot([sin,cos],0,4π)
|
||||
```
|
||||
|
||||

|
||||
|
||||
### Global
|
||||
|
||||
Change the guides/background without a separate call.
|
||||
|
||||
```julia
|
||||
plot(rand(10); title="TITLE",xlabel="XLABEL",ylabel="YLABEL",background_color=RGB(0.5,0.5,0.5))
|
||||
```
|
||||
|
||||

|
||||
|
||||
### Two-axis
|
||||
|
||||
Use the `axis` or `axiss` arguments.
|
||||
|
||||
Note: This is only supported with Qwt right now
|
||||
|
||||
```julia
|
||||
plot(Vector[randn(100),randn(100) * 100]; axiss=[:left,:right])
|
||||
```
|
||||
|
||||

|
||||
|
||||
### Vectors w/ pluralized args
|
||||
|
||||
Plot multiple series with different numbers of points. Mix arguments that apply to all series (singular... see `marker`) with arguments unique to each series (pluralized... see `colors`).
|
||||
|
||||
```julia
|
||||
plot(Vector[rand(10),rand(20)]; marker=:ellipse,markersize=8,colors=[:red,:blue])
|
||||
```
|
||||
|
||||

|
||||
|
||||
### Build plot in pieces
|
||||
|
||||
Start with a base plot...
|
||||
|
||||
```julia
|
||||
plot(rand(100) / 3; reg=true,fillto=0)
|
||||
```
|
||||
|
||||

|
||||
|
||||
###
|
||||
|
||||
and add to it later.
|
||||
|
||||
```julia
|
||||
scatter!(rand(100); markersize=6,color=:blue)
|
||||
```
|
||||
|
||||

|
||||
|
||||
### Heatmaps
|
||||
|
||||
|
||||
|
||||
```julia
|
||||
heatmap(randn(10000),randn(10000); nbins=200)
|
||||
```
|
||||
|
||||

|
||||
|
||||
### Lots of line types
|
||||
|
||||
Options: (:line, :step, :stepinverted, :sticks, :dots, :none, :heatmap, :hexbin, :hist, :bar)
|
||||
Note: some may not work with all backends
|
||||
|
||||
```julia
|
||||
plot(rand(20,4); linetypes=[:line,:step,:sticks,:dots],labels=["line","step","sticks","dots"])
|
||||
```
|
||||
|
||||

|
||||
|
||||
### Bar
|
||||
|
||||
x is the midpoint of the bar. (todo: allow passing of edges instead of midpoints)
|
||||
|
||||
```julia
|
||||
bar(randn(1000))
|
||||
```
|
||||
|
||||

|
||||
|
||||
### Histogram
|
||||
|
||||
note: fillto isn't supported on all backends
|
||||
|
||||
```julia
|
||||
histogram(randn(1000); nbins=50,fillto=20)
|
||||
```
|
||||
|
||||

|
||||
|
||||
### Subplots
|
||||
|
||||
subplot and subplot! are distinct commands which create many plots and add series to them in a circular fashion.
|
||||
You can define the layout with keyword params... either set the number of plots `n` (and optionally number of rows `nr` or
|
||||
number of columns `nc`), or you can set the layout directly with `layout`.
|
||||
|
||||
Note: Gadfly is not very friendly here, and although you can create a plot and save a PNG, I haven't been able to actually display it.
|
||||
|
||||
|
||||
```julia
|
||||
subplot(randn(100,5); layout=[1,1,3],linetypes=[:line,:hist,:dots,:step,:bar],nbins=10,legend=false)
|
||||
```
|
||||
|
||||

|
||||
|
||||
### Adding to subplots
|
||||
|
||||
Note here the automatic grid layout, as well as the order in which new series are added to the plots.
|
||||
|
||||
```julia
|
||||
subplot(randn(100,5); n=4)
|
||||
```
|
||||
|
||||

|
||||
|
||||
###
|
||||
|
||||
|
||||
@ -6,5 +154,5 @@
|
||||
subplot!(randn(100,3))
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
|
||||
@ -6,7 +6,7 @@ A simple line plot of the 3 columns.
|
||||
plot(rand(100,3))
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
### Functions
|
||||
|
||||
@ -16,7 +16,7 @@ Plot multiple functions.
|
||||
plot(0:0.01:4π,[sin,cos])
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
###
|
||||
|
||||
@ -26,7 +26,7 @@ You can also call it with (xmin, xmax).
|
||||
plot([sin,cos],0,4π)
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
### Global
|
||||
|
||||
@ -36,7 +36,7 @@ Change the guides/background without a separate call.
|
||||
plot(rand(10); title="TITLE",xlabel="XLABEL",ylabel="YLABEL",background_color=RGB(0.5,0.5,0.5))
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
### Two-axis
|
||||
|
||||
@ -48,7 +48,7 @@ Note: This is only supported with Qwt right now
|
||||
plot(Vector[randn(100),randn(100) * 100]; axiss=[:left,:right])
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
### Vectors w/ pluralized args
|
||||
|
||||
@ -58,7 +58,7 @@ Plot multiple series with different numbers of points. Mix arguments that apply
|
||||
plot(Vector[rand(10),rand(20)]; marker=:ellipse,markersize=8,colors=[:red,:blue])
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
### Build plot in pieces
|
||||
|
||||
@ -68,7 +68,7 @@ Start with a base plot...
|
||||
plot(rand(100) / 3; reg=true,fillto=0)
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
###
|
||||
|
||||
@ -78,7 +78,7 @@ and add to it later.
|
||||
scatter!(rand(100); markersize=6,color=:blue)
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
### Heatmaps
|
||||
|
||||
@ -88,7 +88,7 @@ scatter!(rand(100); markersize=6,color=:blue)
|
||||
heatmap(randn(10000),randn(10000); nbins=200)
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
### Lots of line types
|
||||
|
||||
@ -96,10 +96,10 @@ Options: (:line, :step, :stepinverted, :sticks, :dots, :none, :heatmap, :hexbin,
|
||||
Note: some may not work with all backends
|
||||
|
||||
```julia
|
||||
plot(rand(20,4); linetypes=[:line,:step,:sticks,:dots])
|
||||
plot(rand(20,4); linetypes=[:line,:step,:sticks,:dots],labels=["line","step","sticks","dots"])
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
### Bar
|
||||
|
||||
@ -109,7 +109,7 @@ x is the midpoint of the bar. (todo: allow passing of edges instead of midpoints
|
||||
bar(randn(1000))
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
### Histogram
|
||||
|
||||
@ -119,7 +119,7 @@ note: fillto isn't supported on all backends
|
||||
histogram(randn(1000); nbins=50,fillto=20)
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
### Subplots
|
||||
|
||||
@ -134,7 +134,7 @@ histogram(randn(1000); nbins=50,fillto=20)
|
||||
subplot(randn(100,5); layout=[1,1,3],linetypes=[:line,:hist,:dots,:step,:bar],nbins=10,legend=false)
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
### Adding to subplots
|
||||
|
||||
@ -144,7 +144,7 @@ Note here the automatic grid layout, as well as the order in which new series ar
|
||||
subplot(randn(100,5); n=4)
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
###
|
||||
|
||||
@ -154,5 +154,5 @@ subplot(randn(100,5); n=4)
|
||||
subplot!(randn(100,3))
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
|
||||
@ -6,7 +6,7 @@ A simple line plot of the 3 columns.
|
||||
plot(rand(100,3))
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
### Functions
|
||||
|
||||
@ -16,7 +16,7 @@ Plot multiple functions.
|
||||
plot(0:0.01:4π,[sin,cos])
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
###
|
||||
|
||||
@ -26,7 +26,7 @@ You can also call it with (xmin, xmax).
|
||||
plot([sin,cos],0,4π)
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
### Global
|
||||
|
||||
@ -36,7 +36,7 @@ Change the guides/background without a separate call.
|
||||
plot(rand(10); title="TITLE",xlabel="XLABEL",ylabel="YLABEL",background_color=RGB(0.5,0.5,0.5))
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
### Two-axis
|
||||
|
||||
@ -48,7 +48,7 @@ Note: This is only supported with Qwt right now
|
||||
plot(Vector[randn(100),randn(100) * 100]; axiss=[:left,:right])
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
### Vectors w/ pluralized args
|
||||
|
||||
@ -58,7 +58,7 @@ Plot multiple series with different numbers of points. Mix arguments that apply
|
||||
plot(Vector[rand(10),rand(20)]; marker=:ellipse,markersize=8,colors=[:red,:blue])
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
### Build plot in pieces
|
||||
|
||||
@ -68,7 +68,7 @@ Start with a base plot...
|
||||
plot(rand(100) / 3; reg=true,fillto=0)
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
###
|
||||
|
||||
@ -78,7 +78,7 @@ and add to it later.
|
||||
scatter!(rand(100); markersize=6,color=:blue)
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
### Lots of line types
|
||||
|
||||
@ -89,7 +89,7 @@ Note: some may not work with all backends
|
||||
plot(rand(20,4); linetypes=[:line,:step,:sticks,:dots],labels=["line","step","sticks","dots"])
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
### Bar
|
||||
|
||||
@ -99,7 +99,7 @@ x is the midpoint of the bar. (todo: allow passing of edges instead of midpoints
|
||||
bar(randn(1000))
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
### Histogram
|
||||
|
||||
@ -109,7 +109,7 @@ note: fillto isn't supported on all backends
|
||||
histogram(randn(1000); nbins=50,fillto=20)
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
### Subplots
|
||||
|
||||
@ -124,7 +124,7 @@ histogram(randn(1000); nbins=50,fillto=20)
|
||||
subplot(randn(100,5); layout=[1,1,3],linetypes=[:line,:hist,:dots,:step,:bar],nbins=10,legend=false)
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
### Adding to subplots
|
||||
|
||||
@ -134,7 +134,7 @@ Note here the automatic grid layout, as well as the order in which new series ar
|
||||
subplot(randn(100,5); n=4)
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
###
|
||||
|
||||
@ -144,5 +144,5 @@ subplot(randn(100,5); n=4)
|
||||
subplot!(randn(100,3))
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
|
||||
BIN
img/gadfly/gadfly_example_1.png
Normal file
|
After Width: | Height: | Size: 78 KiB |
BIN
img/gadfly/gadfly_example_10.png
Normal file
|
After Width: | Height: | Size: 22 KiB |
BIN
img/gadfly/gadfly_example_11.png
Normal file
|
After Width: | Height: | Size: 27 KiB |
BIN
img/gadfly/gadfly_example_12.png
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
img/gadfly/gadfly_example_13.png
Normal file
|
After Width: | Height: | Size: 40 KiB |
BIN
img/gadfly/gadfly_example_14.png
Normal file
|
After Width: | Height: | Size: 58 KiB |
BIN
img/gadfly/gadfly_example_15.png
Normal file
|
After Width: | Height: | Size: 80 KiB |
BIN
img/gadfly/gadfly_example_2.png
Normal file
|
After Width: | Height: | Size: 32 KiB |
BIN
img/gadfly/gadfly_example_3.png
Normal file
|
After Width: | Height: | Size: 32 KiB |
BIN
img/gadfly/gadfly_example_4.png
Normal file
|
After Width: | Height: | Size: 30 KiB |
BIN
img/gadfly/gadfly_example_5.png
Normal file
|
After Width: | Height: | Size: 34 KiB |
BIN
img/gadfly/gadfly_example_6.png
Normal file
|
After Width: | Height: | Size: 37 KiB |
BIN
img/gadfly/gadfly_example_7.png
Normal file
|
After Width: | Height: | Size: 43 KiB |
BIN
img/gadfly/gadfly_example_8.png
Normal file
|
After Width: | Height: | Size: 49 KiB |
BIN
img/gadfly/gadfly_example_9.png
Normal file
|
After Width: | Height: | Size: 133 KiB |
|
Before Width: | Height: | Size: 83 KiB |
|
Before Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 45 KiB |
|
Before Width: | Height: | Size: 60 KiB |
|
Before Width: | Height: | Size: 80 KiB |
|
Before Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 38 KiB |
|
Before Width: | Height: | Size: 42 KiB |
|
Before Width: | Height: | Size: 50 KiB |
|
Before Width: | Height: | Size: 113 KiB |
|
Before Width: | Height: | Size: 24 KiB |
BIN
img/qwt/qwt_example_1.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
img/qwt/qwt_example_10.png
Normal file
|
After Width: | Height: | Size: 8.5 KiB |
BIN
img/qwt/qwt_example_11.png
Normal file
|
After Width: | Height: | Size: 7.5 KiB |
BIN
img/qwt/qwt_example_12.png
Normal file
|
After Width: | Height: | Size: 5.7 KiB |
BIN
img/qwt/qwt_example_13.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
img/qwt/qwt_example_14.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
img/qwt/qwt_example_15.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 8.3 KiB After Width: | Height: | Size: 8.3 KiB |
|
Before Width: | Height: | Size: 7.9 KiB After Width: | Height: | Size: 7.9 KiB |
BIN
img/qwt/qwt_example_4.png
Normal file
|
After Width: | Height: | Size: 8.7 KiB |
BIN
img/qwt/qwt_example_5.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
img/qwt/qwt_example_6.png
Normal file
|
After Width: | Height: | Size: 8.2 KiB |
BIN
img/qwt/qwt_example_7.png
Normal file
|
After Width: | Height: | Size: 9.5 KiB |
BIN
img/qwt/qwt_example_8.png
Normal file
|
After Width: | Height: | Size: 9.2 KiB |
BIN
img/qwt/qwt_example_9.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 7.8 KiB |
|
Before Width: | Height: | Size: 7.4 KiB |
|
Before Width: | Height: | Size: 5.7 KiB |
|
Before Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 8.8 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 7.9 KiB |
|
Before Width: | Height: | Size: 9.4 KiB |
|
Before Width: | Height: | Size: 9.1 KiB |
|
Before Width: | Height: | Size: 17 KiB |
BIN
img/unicodeplots/unicodeplots_example_1.png
Normal file
|
After Width: | Height: | Size: 140 KiB |
BIN
img/unicodeplots/unicodeplots_example_10.png
Normal file
|
After Width: | Height: | Size: 89 KiB |
BIN
img/unicodeplots/unicodeplots_example_11.png
Normal file
|
After Width: | Height: | Size: 70 KiB |
BIN
img/unicodeplots/unicodeplots_example_12.png
Normal file
|
After Width: | Height: | Size: 56 KiB |
BIN
img/unicodeplots/unicodeplots_example_13.png
Normal file
|
After Width: | Height: | Size: 66 KiB |
BIN
img/unicodeplots/unicodeplots_example_14.png
Normal file
|
After Width: | Height: | Size: 64 KiB |
BIN
img/unicodeplots/unicodeplots_example_15.png
Normal file
|
After Width: | Height: | Size: 85 KiB |
|
Before Width: | Height: | Size: 59 KiB After Width: | Height: | Size: 59 KiB |
|
Before Width: | Height: | Size: 61 KiB After Width: | Height: | Size: 61 KiB |
BIN
img/unicodeplots/unicodeplots_example_4.png
Normal file
|
After Width: | Height: | Size: 51 KiB |
BIN
img/unicodeplots/unicodeplots_example_5.png
Normal file
|
After Width: | Height: | Size: 64 KiB |
BIN
img/unicodeplots/unicodeplots_example_6.png
Normal file
|
After Width: | Height: | Size: 65 KiB |
BIN
img/unicodeplots/unicodeplots_example_7.png
Normal file
|
After Width: | Height: | Size: 78 KiB |
BIN
img/unicodeplots/unicodeplots_example_8.png
Normal file
|
After Width: | Height: | Size: 56 KiB |
|
Before Width: | Height: | Size: 144 KiB |
|
Before Width: | Height: | Size: 96 KiB |
|
Before Width: | Height: | Size: 70 KiB |
|
Before Width: | Height: | Size: 55 KiB |
|
Before Width: | Height: | Size: 73 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 82 KiB |
|
Before Width: | Height: | Size: 51 KiB |
|
Before Width: | Height: | Size: 67 KiB |
|
Before Width: | Height: | Size: 69 KiB |
|
Before Width: | Height: | Size: 77 KiB |
|
Before Width: | Height: | Size: 55 KiB |
@ -27,7 +27,7 @@ function plot(pkg::GadflyPackage; kw...)
|
||||
|
||||
plt.theme = Gadfly.Theme(background_color = (haskey(d, :background_color) ? d[:background_color] : colorant"white"))
|
||||
|
||||
Plot(plt, pkg, 0, kw, Dict[])
|
||||
Plot(plt, pkg, 0, d, Dict[])
|
||||
end
|
||||
|
||||
function getGeomFromLineType(linetype::Symbol, nbins::Int)
|
||||
@ -96,7 +96,7 @@ function plot!(::GadflyPackage, plt::Plot; kw...)
|
||||
end
|
||||
|
||||
# save the kw args
|
||||
plt.push!(plt.seriesargs, d)
|
||||
push!(plt.seriesargs, d)
|
||||
|
||||
# add the layer to the Gadfly.Plot
|
||||
prepend!(plt.o.layers, Gadfly.layer(unique(gfargs)...; x = x, y = d[:y]))
|
||||
|
||||