name changes; require to 0.4
This commit is contained in:
parent
58041cc64e
commit
391c7e8570
@ -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]),
|
||||
|
||||
@ -8,6 +8,8 @@ function createImmerseFigure(d::Dict)
|
||||
Immerse.Figure(figidx)
|
||||
end
|
||||
|
||||
# ----------------------------------------------------------------
|
||||
|
||||
|
||||
# create a blank Gadfly.Plot object
|
||||
function _create_plot(pkg::ImmersePackage; kw...)
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
@ -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...)
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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
|
||||
|
||||
# --------------------------------------------------------------------
|
||||
|
||||
|
||||
@ -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\").")
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
julia 0.3
|
||||
julia 0.4
|
||||
|
||||
Colors
|
||||
Reexport
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user