working on subplot
This commit is contained in:
parent
36047e2928
commit
fb2561e7e5
10
src/qwt.jl
10
src/qwt.jl
@ -48,7 +48,15 @@ savepng(::QwtPackage, plt::PlottingObject, fn::String, args...) = Qwt.savepng(pl
|
||||
# o = buildSubplotObject(plts, pkg, layout)
|
||||
|
||||
function buildSubplotObject(plts::Vector{Plot}, pkg::QwtPackage, layout::SubplotLayout)
|
||||
Qwt.vsplitter([Qwt.hsplitter([plt.o for plt in plts[i:(i+rowcnt-1)]]...) for rowcnt in layout.rowcounts]...)
|
||||
@show plts pkg layout
|
||||
i = 0
|
||||
rows = []
|
||||
for rowcnt in layout.rowcounts
|
||||
push!(rows, Qwt.hsplitter([plt.o for plt in plts[(1:rowcnt) + i]]...))
|
||||
i += rowcnt
|
||||
end
|
||||
@show rows
|
||||
Qwt.vsplitter(rows...)
|
||||
end
|
||||
|
||||
|
||||
|
||||
@ -58,13 +58,13 @@ function subplot(args...; kw...)
|
||||
d = Dict(kw)
|
||||
|
||||
# figure out the layout
|
||||
if !haskey(d, :layout)
|
||||
layout = FixedLayout(d[:layout])
|
||||
if haskey(d, :layout)
|
||||
layout = SubplotLayout(d[:layout])
|
||||
else
|
||||
if !haskey(d, :n)
|
||||
error("You must specify either layout or n when creating a subplot: ", d)
|
||||
end
|
||||
layout = AutoGridLayout(d[:n], get(d, :numrows, -1), get(d, :numcols, -1))
|
||||
layout = SubplotLayout(d[:n], get(d, :numrows, -1), get(d, :numcols, -1))
|
||||
end
|
||||
|
||||
# initialize the individual plots
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user