From 391c7e857057633b914f113d02659bcd6f01649f Mon Sep 17 00:00:00 2001 From: Thomas Breloff Date: Fri, 6 Nov 2015 11:46:24 -0500 Subject: [PATCH] name changes; require to 0.4 --- REQUIRE | 2 +- src/backends/gadfly.jl | 2 +- src/backends/immerse.jl | 2 ++ src/backends/pyplot.jl | 8 ++++---- src/backends/qwt.jl | 8 ++------ src/backends/unicodeplots.jl | 4 ++-- src/backends/winston.jl | 6 +++--- src/plot.jl | 8 ++++---- src/plotter.jl | 4 ++-- src/subplot.jl | 12 ++++++------ test/REQUIRE | 2 +- 11 files changed, 28 insertions(+), 30 deletions(-) diff --git a/REQUIRE b/REQUIRE index 0871e558..04b7f31e 100644 --- a/REQUIRE +++ b/REQUIRE @@ -1,4 +1,4 @@ -julia 0.3 +julia 0.4 Colors Reexport diff --git a/src/backends/gadfly.jl b/src/backends/gadfly.jl index 8b72fb02..bcd7d08b 100644 --- a/src/backends/gadfly.jl +++ b/src/backends/gadfly.jl @@ -7,7 +7,7 @@ function createGadflyPlotObject(d::Dict) gplt = Gadfly.Plot() gplt.mapping = Dict() - gplt.data_source = DataFrames.DataFrame() + gplt.data_source = Gadfly.DataFrames.DataFrame() gplt.layers = gplt.layers[1:0] gplt.guides = Gadfly.GuideElement[Gadfly.Guide.xlabel(d[:xlabel]), Gadfly.Guide.ylabel(d[:ylabel]), diff --git a/src/backends/immerse.jl b/src/backends/immerse.jl index f01f8b66..ab59ef2e 100644 --- a/src/backends/immerse.jl +++ b/src/backends/immerse.jl @@ -8,6 +8,8 @@ function createImmerseFigure(d::Dict) Immerse.Figure(figidx) end +# ---------------------------------------------------------------- + # create a blank Gadfly.Plot object function _create_plot(pkg::ImmersePackage; kw...) diff --git a/src/backends/pyplot.jl b/src/backends/pyplot.jl index fec33f57..14c9b392 100644 --- a/src/backends/pyplot.jl +++ b/src/backends/pyplot.jl @@ -156,7 +156,7 @@ makePyPlotCurrent(wrap::PyPlotAxisWrapper) = nothing #PyPlot.sca(wrap.ax.o) makePyPlotCurrent(plt::Plot{PyPlotPackage}) = makePyPlotCurrent(plt.o) -function preparePlotUpdate(plt::Plot{PyPlotPackage}) +function _before_add_series(plt::Plot{PyPlotPackage}) makePyPlotCurrent(plt) end @@ -171,7 +171,7 @@ end # screen # Integer, move enclosing window to this screen number (for multiscreen desktops) # show # true or false, show the plot (in case you don't want the window to pop up right away) -function plot(pkg::PyPlotPackage; kw...) +function _create_plot(pkg::PyPlotPackage; kw...) # create the figure d = Dict(kw) @@ -189,7 +189,7 @@ function plot(pkg::PyPlotPackage; kw...) end -function plot!(pkg::PyPlotPackage, plt::Plot; kw...) +function _add_series(pkg::PyPlotPackage, plt::Plot; kw...) d = Dict(kw) lt = d[:linetype] @@ -545,7 +545,7 @@ function subplot(plts::AVec{Plot{PyPlotPackage}}, layout::SubplotLayout, d::Dict for (i,plt) in enumerate(plts) for seriesargs in plt.seriesargs - _plot_from_subplot!(newplts[i]; seriesargs...) + _add_series_subplot(newplts[i]; seriesargs...) end end diff --git a/src/backends/qwt.jl b/src/backends/qwt.jl index 6b853344..81492fd1 100644 --- a/src/backends/qwt.jl +++ b/src/backends/qwt.jl @@ -70,7 +70,7 @@ function adjustQwtKeywords(plt::Plot{QwtPackage}, iscreating::Bool; kw...) d end -function plot(pkg::QwtPackage; kw...) +function _create_plot(pkg::QwtPackage; kw...) d = Dict(kw) fixcolors(d) dumpdict(d,"\n\n!!! plot") @@ -79,7 +79,7 @@ function plot(pkg::QwtPackage; kw...) plt end -function plot!(::QwtPackage, plt::Plot; kw...) +function _add_series(::QwtPackage, plt::Plot; kw...) d = adjustQwtKeywords(plt, false; kw...) fixcolors(d) dumpdict(d,"\n\n!!! plot!") @@ -270,10 +270,6 @@ function Base.display(::PlotsDisplay, subplt::Subplot{QwtPackage}) for plt in subplt.plts Qwt.refresh(plt.o) end - # iargs = getinitargs(subplt,1) - # # iargs = subplt.initargs - # Qwt.resizewidget(subplt.o, iargs[:size]...) - # Qwt.movewidget(subplt.o, iargs[:pos]...) Qwt.showwidget(subplt.o) end diff --git a/src/backends/unicodeplots.jl b/src/backends/unicodeplots.jl index f2098c9d..3d1922e0 100644 --- a/src/backends/unicodeplots.jl +++ b/src/backends/unicodeplots.jl @@ -112,7 +112,7 @@ end # ------------------------------- -function plot(pkg::UnicodePlotsPackage; kw...) +function _create_plot(pkg::UnicodePlotsPackage; kw...) plt = Plot(nothing, pkg, 0, Dict(kw), Dict[]) # do we want to give a new default size? @@ -123,7 +123,7 @@ function plot(pkg::UnicodePlotsPackage; kw...) plt end -function plot!(::UnicodePlotsPackage, plt::Plot; kw...) +function _add_series(::UnicodePlotsPackage, plt::Plot; kw...) d = Dict(kw) if d[:linetype] in (:sticks, :bar) d = barHack(; d...) diff --git a/src/backends/winston.jl b/src/backends/winston.jl index 3f92e911..ef155341 100644 --- a/src/backends/winston.jl +++ b/src/backends/winston.jl @@ -25,14 +25,14 @@ :star5 => "asterisk" ) -function preparePlotUpdate(plt::Plot{WinstonPackage}) +function _before_add_series(plt::Plot{WinstonPackage}) Winston.ghf(plt.o) end # --------------------------------------------------------------------------- -function plot(pkg::WinstonPackage; kw...) +function _create_plot(pkg::WinstonPackage; kw...) d = Dict(kw) wplt = Winston.FramedPlot(title = d[:title], xlabel = d[:xlabel], ylabel = d[:ylabel]) @@ -56,7 +56,7 @@ function getWinstonItems(plt::Plot) window, canvas, wplt end -function plot!(::WinstonPackage, plt::Plot; kw...) +function _add_series(::WinstonPackage, plt::Plot; kw...) d = Dict(kw) window, canvas, wplt = getWinstonItems(plt) diff --git a/src/plot.jl b/src/plot.jl index e79e39be..77b16da2 100644 --- a/src/plot.jl +++ b/src/plot.jl @@ -50,7 +50,7 @@ function plot(args...; kw...) plotargs = getPlotArgs(pkg, d, 1) dumpdict(plotargs, "Plot args") - plt = plot(pkg; plotargs...) # create a new, blank plot + plt = _create_plot(pkg; plotargs...) # create a new, blank plot delete!(d, :background_color) plot!(plt, args...; d...) # add to it @@ -87,7 +87,7 @@ function plot!(plt::Plot, args...; kw...) groupargs = get(d, :group, nothing) == nothing ? [] : [extractGroupArgs(d[:group], args...)] # just in case the backend needs to set up the plot (make it current or something) - preparePlotUpdate(plt) + _before_add_series(plt) # get the list of dictionaries, one per series seriesArgList, xmeta, ymeta = createKWargsList(plt, groupargs..., args...; d...) @@ -111,7 +111,7 @@ function plot!(plt::Plot, args...; kw...) dumpdict(di, "Series $i") - plot!(plt.backend, plt; di...) + _add_series(plt.backend, plt; di...) end _add_annotations(plt, d) @@ -163,7 +163,7 @@ end # -------------------------------------------------------------------- -preparePlotUpdate(plt::Plot) = nothing +_before_add_series(plt::Plot) = nothing # -------------------------------------------------------------------- diff --git a/src/plotter.jl b/src/plotter.jl index 3976617c..4bd28049 100644 --- a/src/plotter.jl +++ b/src/plotter.jl @@ -151,8 +151,8 @@ function backend() elseif currentBackendSymbol == :gadfly try - @eval import Gadfly, Compose, DataFrames - @eval export Gadfly, Compose, DataFrames + @eval import Gadfly, Compose + @eval export Gadfly, Compose @eval include(joinpath(Pkg.dir("Plots"), "src", "backends", "gadfly_shapes.jl")) catch err warn("Couldn't import Gadfly. Install it with: Pkg.add(\"Gadfly\").") diff --git a/src/subplot.jl b/src/subplot.jl index b0a2a586..94499fe7 100644 --- a/src/subplot.jl +++ b/src/subplot.jl @@ -82,7 +82,7 @@ Base.getindex(subplt::Subplot, args...) = subplt.plts[subplt.layout[args...]] # handle "linking" the subplot axes together # each backend should implement the _remove_axis and _expand_limits methods -function linkAxis(subplt::Subplot, isx::Bool) +function link_axis(subplt::Subplot, isx::Bool) # collect the list of plots and the expanded limits for those plots that should be linked on this axis includedPlots = Any[] @@ -175,7 +175,7 @@ function subplot(args...; kw...) di = getPlotArgs(pkg, d, i) di[:subplot] = true dumpdict(di, "Plot args (subplot $i)") - push!(plts, plot(pkg; di...)) + push!(plts, _create_plot(pkg; di...)) end # create the object and do the plotting @@ -264,8 +264,8 @@ function _postprocess_subplot(subplt::Subplot, d::Dict) _update_plot_pos_size(subplt, d) # handle links - subplt.linkx && linkAxis(subplt, true) - subplt.linky && linkAxis(subplt, false) + subplt.linkx && link_axis(subplt, true) + subplt.linky && link_axis(subplt, false) # set this to be current current(subplt) @@ -335,7 +335,7 @@ function subplot!(subplt::Subplot, args...; kw...) dumpdict(di, "subplot! kwList $i") dumpdict(plt.initargs, "plt.initargs before plotting") - _plot_from_subplot!(plt; di...) + _add_series_subplot(plt; di...) end _postprocess_subplot(subplt, d) @@ -350,7 +350,7 @@ end -function _plot_from_subplot!(plt::Plot, args...; kw...) +function _add_series_subplot(plt::Plot, args...; kw...) d = Dict(kw) setTicksFromStringVector(d, d, :x, :xticks) diff --git a/test/REQUIRE b/test/REQUIRE index a5de3587..8dbd52ff 100644 --- a/test/REQUIRE +++ b/test/REQUIRE @@ -1,4 +1,4 @@ -julia 0.3 +julia 0.4 Colors Reexport