diff --git a/README.md b/README.md index 2f7e3b7a..a4df9e63 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,8 @@ Pkg.add("Gadfly") Pkg.add("Immerse") Pkg.add("PyPlot") Pkg.add("UnicodePlots") -Pkg.clone("https://github.com/tbreloff/Qwt.jl.git") +Pkg.add("Qwt") +Pkg.add("Bokeh") ``` ## Use @@ -206,14 +207,13 @@ Keyword | Default | Type | Aliases ---- | ---- | ---- | ---- `:annotation` | `nothing` | Series | `:ann`, `:annotate`, `:annotations`, `:anns` `:axis` | `left` | Series | `:axiss` -`:background_color` | `RGB{U8}(1.0,1.0,1.0)` | Plot | `:background`, `:bg`, `:bg_color`, `:bgcolor` -`:color` | `auto` | Series | `:c`, `:colors` +`:background_color` | `RGB{U8}(1.0,1.0,1.0)` | Plot | `:background`, `:background_colour`, `:bg`, `:bg_color`, `:bgcolor` `:color_palette` | `auto` | Plot | `:palette` `:fill` | `nothing` | Series | `:area`, `:f` -`:fillcolor` | `match` | Series | `:fc`, `:fcolor`, `:fillcolors` -`:fillalpha` | `nothing` | Series | `:fillalphas`, `:fo` +`:fillalpha` | `nothing` | Series | `:fa`, `:fillalphas`, `:fillopacity` +`:fillcolor` | `match` | Series | `:fc`, `:fcolor`, `:fillcolors`, `:fillcolour` `:fillrange` | `nothing` | Series | `:fillranges`, `:fillrng` -`:foreground_color` | `auto` | Plot | `:fg`, `:fg_color`, `:fgcolor`, `:foreground` +`:foreground_color` | `auto` | Plot | `:fg`, `:fg_color`, `:fgcolor`, `:foreground`, `:foreground_colour` `:grid` | `true` | Plot | `:group` | `nothing` | Series | `:g`, `:groups` `:guidefont` | `Plots.Font("Helvetica",11,:hcenter,:vcenter,0.0,RGB{U8}(0.0,0.0,0.0))` | Plot | @@ -222,7 +222,8 @@ Keyword | Default | Type | Aliases `:legend` | `true` | Plot | `:leg` `:legendfont` | `Plots.Font("Helvetica",8,:hcenter,:vcenter,0.0,RGB{U8}(0.0,0.0,0.0))` | Plot | `:line` | `nothing` | Series | `:l` -`:linealpha` | `nothing` | Series | `:linealphas`, `:lo` +`:linealpha` | `nothing` | Series | `:la`, `:linealphas`, `:lineopacity` +`:linecolor` | `auto` | Series | `:c`, `:color`, `:colour`, `:linecolors` `:linestyle` | `solid` | Series | `:linestyles`, `:ls`, `:s`, `:style` `:linetype` | `path` | Series | `:linetypes`, `:lt`, `:t`, `:type` `:linewidth` | `1` | Series | `:linewidths`, `:lw`, `:w`, `:width` @@ -231,18 +232,24 @@ Keyword | Default | Type | Aliases `:linkx` | `false` | Plot | `:xlink` `:linky` | `false` | Plot | `:ylink` `:marker` | `nothing` | Series | `:m`, `:mark` -`:markercolor` | `match` | Series | `:markercolors`, `:mc`, `:mcolor` -`:markeralpha` | `nothing` | Series | `:alpha`, `:markeralphas`, `:mo`, `:alpha` +`:markeralpha` | `nothing` | Series | `:alpha`, `:ma`, `:markeralphas`, `:markeropacity`, `:opacity` +`:markercolor` | `match` | Series | `:markercolors`, `:markercolour`, `:mc`, `:mcolor` `:markershape` | `none` | Series | `:markershapes`, `:shape` `:markersize` | `6` | Series | `:markersizes`, `:ms`, `:msize` +`:markerstrokealpha` | `nothing` | Series | `:markerstrokealphas` +`:markerstrokecolor` | `match` | Series | `:markerstrokecolors` +`:markerstrokestyle` | `solid` | Series | `:markerstrokestyles` +`:markerstrokewidth` | `1` | Series | `:markerstrokewidths` `:n` | `-1` | Plot | -`:nbins` | `100` | Series | `:nb`, `:nbin`, `:nbinss` +`:nbins` | `30` | Series | `:nb`, `:nbin`, `:nbinss` `:nc` | `-1` | Plot | +`:nlevels` | `15` | Series | `:nlevelss` `:nr` | `-1` | Plot | `:pos` | `(0,0)` | Plot | `:show` | `false` | Plot | `:display`, `:gui` `:size` | `(500,300)` | Plot | `:windowsize`, `:wsize` `:smooth` | `false` | Series | `:reg`, `:regression`, `:smooths` +`:surface` | `nothing` | Series | `:surfaces` `:tickfont` | `Plots.Font("Helvetica",8,:hcenter,:vcenter,0.0,RGB{U8}(0.0,0.0,0.0))` | Plot | `:title` | `` | Plot | `:windowtitle` | `Plots.jl` | Plot | `:wtitle` @@ -280,6 +287,9 @@ Type | Desc | Aliases `:hline` | Horizontal line (doesn't use x) | `:vline` | Vertical line (doesn't use x) | `:ohlc` | Open/High/Low/Close chart (expects y is AbstractVector{Plots.OHLC}) | +`:contour` | Contour lines (uses z) | +`:path3d` | 3D path (uses z) | `:line3d` +`:scatter3d` | 3D scatter plot (uses z) | ### Line styles: diff --git a/docs/example_generation.jl b/docs/example_generation.jl index 766b39d6..0047a324 100644 --- a/docs/example_generation.jl +++ b/docs/example_generation.jl @@ -301,20 +301,23 @@ end @compat const _ltdesc = Dict( - :none => "No line", - :line => "Lines with sorted x-axis", - :path => "Lines", - :steppre => "Step plot (vertical then horizontal)", - :steppost => "Step plot (horizontal then vertical)", - :sticks => "Vertical lines", - :scatter => "Points, no lines", - :heatmap => "Colored regions by density", - :hexbin => "Similar to heatmap", - :hist => "Histogram (doesn't use x)", - :bar => "Bar plot (centered on x values)", - :hline => "Horizontal line (doesn't use x)", - :vline => "Vertical line (doesn't use x)", - :ohlc => "Open/High/Low/Close chart (expects y is AbstractVector{Plots.OHLC})", + :none => "No line", + :line => "Lines with sorted x-axis", + :path => "Lines", + :steppre => "Step plot (vertical then horizontal)", + :steppost => "Step plot (horizontal then vertical)", + :sticks => "Vertical lines", + :scatter => "Points, no lines", + :heatmap => "Colored regions by density", + :hexbin => "Similar to heatmap", + :hist => "Histogram (doesn't use x)", + :bar => "Bar plot (centered on x values)", + :hline => "Horizontal line (doesn't use x)", + :vline => "Vertical line (doesn't use x)", + :ohlc => "Open/High/Low/Close chart (expects y is AbstractVector{Plots.OHLC})", + :contour => "Contour lines (uses z)", + :path3d => "3D path (uses z)", + :scatter3d => "3D scatter plot (uses z)", ) function buildReadme() diff --git a/docs/readme_template.md b/docs/readme_template.md index ba386554..d62761c6 100644 --- a/docs/readme_template.md +++ b/docs/readme_template.md @@ -52,7 +52,8 @@ Pkg.add("Gadfly") Pkg.add("Immerse") Pkg.add("PyPlot") Pkg.add("UnicodePlots") -Pkg.clone("https://github.com/tbreloff/Qwt.jl.git") +Pkg.add("Qwt") +Pkg.add("Bokeh") ``` ## Use diff --git a/img/supported/Plots.supportGraphArgs.png b/img/supported/Plots.supportGraphArgs.png index 1224720d..5afa4469 100644 Binary files a/img/supported/Plots.supportGraphArgs.png and b/img/supported/Plots.supportGraphArgs.png differ diff --git a/img/supported/Plots.supportGraphAxes.png b/img/supported/Plots.supportGraphAxes.png index bc6d93c6..0c5293ac 100644 Binary files a/img/supported/Plots.supportGraphAxes.png and b/img/supported/Plots.supportGraphAxes.png differ diff --git a/img/supported/Plots.supportGraphMarkers.png b/img/supported/Plots.supportGraphMarkers.png index 02b73ff4..eef5f598 100644 Binary files a/img/supported/Plots.supportGraphMarkers.png and b/img/supported/Plots.supportGraphMarkers.png differ diff --git a/img/supported/Plots.supportGraphScales.png b/img/supported/Plots.supportGraphScales.png index a094fc45..74b7f4f7 100644 Binary files a/img/supported/Plots.supportGraphScales.png and b/img/supported/Plots.supportGraphScales.png differ diff --git a/img/supported/Plots.supportGraphStyles.png b/img/supported/Plots.supportGraphStyles.png index 505648b2..cd1ba825 100644 Binary files a/img/supported/Plots.supportGraphStyles.png and b/img/supported/Plots.supportGraphStyles.png differ diff --git a/img/supported/Plots.supportGraphTypes.png b/img/supported/Plots.supportGraphTypes.png index 2a3c3e56..65f77baf 100644 Binary files a/img/supported/Plots.supportGraphTypes.png and b/img/supported/Plots.supportGraphTypes.png differ diff --git a/src/backends/bokeh.jl b/src/backends/bokeh.jl index 50595e9e..c62e51e1 100644 --- a/src/backends/bokeh.jl +++ b/src/backends/bokeh.jl @@ -137,7 +137,7 @@ end # ---------------------------------------------------------------- -function _create_subplot(subplt::Subplot{BokehPackage}) +function _create_subplot(subplt::Subplot{BokehPackage}, isbefore::Bool) # TODO: build the underlying Subplot object. this is where you might layout the panes within a GUI window, for example end diff --git a/src/backends/gadfly.jl b/src/backends/gadfly.jl index ac72faf7..9408ce2d 100644 --- a/src/backends/gadfly.jl +++ b/src/backends/gadfly.jl @@ -159,7 +159,7 @@ function addGadflyMarker!(plt::Plot, numlayers::Int, d::Dict, plotargs::Dict, ge # handle continuous color scales for the markers z = d[:z] if z != nothing && typeof(z) <: AVec - kwargs[:linecolor] = z + kwargs[:color] = z if !isa(d[:markercolor], ColorGradient) d[:markercolor] = colorscheme(:bluesreds) end diff --git a/src/backends/pyplot.jl b/src/backends/pyplot.jl index c62106ff..7df9dbe4 100644 --- a/src/backends/pyplot.jl +++ b/src/backends/pyplot.jl @@ -148,7 +148,6 @@ end handleSmooth(plt::Plot{PyPlotPackage}, ax, d::Dict, smooth::Real) = handleSmooth(plt, ax, d, true) -nop() = nothing makePyPlotCurrent(wrap::PyPlotFigWrapper) = PyPlot.figure(wrap.fig.o[:number]) diff --git a/src/plot.jl b/src/plot.jl index 31147429..2cea2c46 100644 --- a/src/plot.jl +++ b/src/plot.jl @@ -225,7 +225,15 @@ convertToAnyVector(f::Function; kw...) = Any[f], nothing convertToAnyVector(v::AVec{OHLC}; kw...) = Any[v], nothing # list of things (maybe other vectors, functions, or something else) -convertToAnyVector(v::AVec; kw...) = Any[vi for vi in v], nothing +function convertToAnyVector(v::AVec; kw...) + if all(x -> typeof(x) <: Real, v) + # all real numbers wrap the whole vector as one item + Any[convert(Vector{Float64}, v)], nothing + else + # something else... treat each element as an item + Any[vi for vi in v], nothing + end +end # -------------------------------------------------------------------- @@ -254,8 +262,6 @@ function createKWargsList(plt::PlottingObject, x, y; kw...) xs, xmeta = convertToAnyVector(x; kw...) ys, ymeta = convertToAnyVector(y; kw...) - # _debugMode.on && dumpcallstack() - mx = length(xs) my = length(ys) ret = Any[] diff --git a/src/utils.jl b/src/utils.jl index 30813d20..74d77e26 100644 --- a/src/utils.jl +++ b/src/utils.jl @@ -116,6 +116,9 @@ end # ------------------------------------------------------------------------------------ + +nop() = nothing + get_mod(v::AVec, idx::Int) = v[mod1(idx, length(v))] get_mod(v::AMat, idx::Int) = size(v,1) == 1 ? v[1, mod1(idx, size(v,2))] : v[:, mod1(idx, size(v,2))] get_mod(v, idx::Int) = v diff --git a/test/imgcomp.jl b/test/imgcomp.jl index dd528705..9193f3ea 100644 --- a/test/imgcomp.jl +++ b/test/imgcomp.jl @@ -54,13 +54,21 @@ end "Show a Gtk popup with both images and a confirmation whether we should replace the new image with the old one" function compareToReferenceImage(tmpfn, reffn) - @eval import Gtk + println("here000") + # @eval import Gtk + Gtk.gtk_main() + println("huh0") + sleep(2) # add the images imgbox = Gtk.GtkBoxLeaf(:h) + println("huh") push!(imgbox, makeImageWidget(tmpfn)) + println("huh2") push!(imgbox, makeImageWidget(reffn)) + println("here00") + # add the buttons # doNothingButton = Gtk.GtkButtonLeaf("Skip") # replaceReferenceButton = Gtk.GtkButtonLeaf("Replace reference image") @@ -75,14 +83,28 @@ function compareToReferenceImage(tmpfn, reffn) win = Gtk.GtkWindowLeaf("Should we make this the new reference image?") push!(win, Gtk.GtkFrameLeaf(imgbox)) + println("here01") + + ################ + # TODO: remove this when it's fixed in Gtk... see http://stackoverflow.com/questions/33549485/julia-gtk-windows-do-not-display-outside-repl + signal_connect(win, :destroy) do widget + Gtk.gtk_quit() + end + ################ + + println("here02") showall(win) + println("here1") + # now ask the question if Gtk.ask_dialog("Should we make this the new reference image?", "No", "Yes") replaceReferenceImage(tmpfn, reffn) end + println("here2") destroy(win) + println("here3") # # we'll wait on this condition # c = Condition() @@ -156,13 +178,14 @@ function image_comparison_tests(pkg::Symbol, idx::Int; debug = false, sigma = [1 catch err warn("Image did not match reference image $reffn. err: $err") - showerror(Base.STDERR, err) + # showerror(Base.STDERR, err) if isinteractive() # if we're in interactive mode, open a popup and give us a chance to examine the images warn("Should we make this the new reference image?") compareToReferenceImage(tmpfn, reffn) + println("exited") return else