diff --git a/README.md b/README.md index 6fa907d9..f27a8cc0 100644 --- a/README.md +++ b/README.md @@ -188,7 +188,7 @@ When plotting multiple lines, you can give every line the same trait by using th - [x] Plot vectors/matrices/functions - [ ] Plot DataFrames - [ ] Subplots -- [x] Histograms +- [ ] Histograms - [ ] 3D plotting - [ ] Scenes/Drawing - [ ] Graphs diff --git a/docs/example_generation.jl b/docs/example_generation.jl index e24f9767..b0d74216 100644 --- a/docs/example_generation.jl +++ b/docs/example_generation.jl @@ -37,6 +37,12 @@ const examples = PlotExample[ PlotExample("Build plot in pieces", "You can add to a plot at any time.", [:(plot(rand(100)/3; reg=true, fillto=0)), :(scatter!(rand(100); markersize=6, color=:blue))]), + PlotExample("Heatmaps", + "", + [:(heatmap(randn(10000),randn(10000); nbins=200))]), + PlotExample("Lots of line types", + "Options: (:line, :step, :stepinverted, :sticks, :dots, :none, :heatmap, :hexbin, :hist, :bar) \nNote: some may not work with all backends", + [:(plot(rand(20,4); linetypes=[:line, :step, :sticks, :dots]))]), ] diff --git a/docs/gadfly_examples.md b/docs/gadfly_examples.md index e2d1575a..4513ec62 100644 --- a/docs/gadfly_examples.md +++ b/docs/gadfly_examples.md @@ -59,3 +59,24 @@ scatter!(rand(100); markersize=6,color=:blue) ![](../img/gadfly_example_6.png) +### Heatmaps + + + +```julia +heatmap(randn(10000),randn(10000); nbins=200) +``` + +![](../img/gadfly_example_7.png) + +### 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]) +``` + +![](../img/gadfly_example_8.png) + diff --git a/docs/qwt_examples.md b/docs/qwt_examples.md index 29458fd9..d7910732 100644 --- a/docs/qwt_examples.md +++ b/docs/qwt_examples.md @@ -59,3 +59,24 @@ scatter!(rand(100); markersize=6,color=:blue) ![](../img/qwt_example_6.png) +### Heatmaps + + + +```julia +heatmap(randn(10000),randn(10000); nbins=200) +``` + +![](../img/qwt_example_7.png) + +### 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]) +``` + +![](../img/qwt_example_8.png) + diff --git a/img/gadfly_example_1.png b/img/gadfly_example_1.png index 2a6fa158..66abdf17 100644 Binary files a/img/gadfly_example_1.png and b/img/gadfly_example_1.png differ diff --git a/img/gadfly_example_3.png b/img/gadfly_example_3.png index 4366b5f1..0c95c530 100644 Binary files a/img/gadfly_example_3.png and b/img/gadfly_example_3.png differ diff --git a/img/gadfly_example_4.png b/img/gadfly_example_4.png index 8d802ef9..418d9c92 100644 Binary files a/img/gadfly_example_4.png and b/img/gadfly_example_4.png differ diff --git a/img/gadfly_example_5.png b/img/gadfly_example_5.png index ecb3fa7d..5216a218 100644 Binary files a/img/gadfly_example_5.png and b/img/gadfly_example_5.png differ diff --git a/img/gadfly_example_6.png b/img/gadfly_example_6.png index 3e1271db..2daf4ec2 100644 Binary files a/img/gadfly_example_6.png and b/img/gadfly_example_6.png differ diff --git a/img/qwt_example_1.png b/img/qwt_example_1.png index 9d5da77a..4c5838d1 100644 Binary files a/img/qwt_example_1.png and b/img/qwt_example_1.png differ diff --git a/img/qwt_example_3.png b/img/qwt_example_3.png index 9cfea17e..671e7b7e 100644 Binary files a/img/qwt_example_3.png and b/img/qwt_example_3.png differ diff --git a/img/qwt_example_4.png b/img/qwt_example_4.png index d792e301..bc1463d5 100644 Binary files a/img/qwt_example_4.png and b/img/qwt_example_4.png differ diff --git a/img/qwt_example_5.png b/img/qwt_example_5.png index c810a75b..a778b9d6 100644 Binary files a/img/qwt_example_5.png and b/img/qwt_example_5.png differ diff --git a/img/qwt_example_6.png b/img/qwt_example_6.png index 7f829ee4..ce484d30 100644 Binary files a/img/qwt_example_6.png and b/img/qwt_example_6.png differ diff --git a/src/gadfly.jl b/src/gadfly.jl index c38bdafb..a0684b1b 100644 --- a/src/gadfly.jl +++ b/src/gadfly.jl @@ -37,6 +37,7 @@ function getGeomFromLineType(linetype::Symbol) linetype == :step && return Gadfly.Geom.step linetype == :hist && return Gadfly.Geom.hist linetype == :none && return Gadfly.Geom.point # change this? are we usually pairing no line with scatterplots? + linetype == :sticks && return Gadfly.Geom.bar error("linetype $linetype not currently supported with Gadfly") end diff --git a/src/qwt.jl b/src/qwt.jl index 40790961..900e7baf 100644 --- a/src/qwt.jl +++ b/src/qwt.jl @@ -7,6 +7,9 @@ function adjustQwtKeywords(; kw...) d = Dict(kw) if d[:linetype] == :hexbin d[:linetype] = :heatmap + elseif d[:linetype] == :dots + d[:linetype] = :none + d[:marker] = :hexagon end d[:heatmap_n] = d[:nbins] d