remove groupplots

This commit is contained in:
Simon Christ 2020-01-10 13:44:50 +01:00
parent 68c1eb2e3c
commit b322e11682

View File

@ -94,20 +94,21 @@ function (pgfx_plot::PGFPlotsXPlot)(plt::Plot{PGFPlotsXBackend})
end end
# the combination of groupplot and polaraxis is broken in pgfplots # the combination of groupplot and polaraxis is broken in pgfplots
if !any( sp -> ispolar(sp), plt.subplots ) # if !any( sp -> ispolar(sp), plt.subplots )
pl_height, pl_width = plt.attr[:size] # pl_height, pl_width = plt.attr[:size]
push!( the_plot, PGFPlotsX.GroupPlot( # push!( the_plot, PGFPlotsX.GroupPlot(
PGFPlotsX.Options( # PGFPlotsX.Options(
"group style" => PGFPlotsX.Options( # "group style" => PGFPlotsX.Options(
"group size" => string(cols)*" by "*string(rows), # "group size" => string(cols)*" by "*string(rows),
"horizontal sep" => string(maximum(sp -> sp.minpad[1], plt.subplots)), # "horizontal sep" => string(maximum(sp -> sp.minpad[1], plt.subplots)),
"vertical sep" => string(maximum(sp -> sp.minpad[2], plt.subplots)), # "vertical sep" => string(maximum(sp -> sp.minpad[2], plt.subplots)),
), # ),
"height" => pl_height > 0 ? string(pl_height * px) : "{}", # "height" => pl_height > 0 ? string(pl_height * px) : "{}",
"width" => pl_width > 0 ? string(pl_width * px) : "{}", # "width" => pl_width > 0 ? string(pl_width * px) : "{}",
) # )
)) # )
end # )
# end
inset_subplots = plt.inset_subplots inset_subplots = plt.inset_subplots
parents = getproperty.(inset_subplots, :parent) parents = getproperty.(inset_subplots, :parent)
for sp in plt.subplots for sp in plt.subplots
@ -351,11 +352,6 @@ function (pgfx_plot::PGFPlotsXPlot)(plt::Plot{PGFPlotsXBackend})
pgfx_add_annotation!(axis, xi, yi, txt, pgfx_thickness_scaling(sp)) pgfx_add_annotation!(axis, xi, yi, txt, pgfx_thickness_scaling(sp))
end end
end end
if ispolar(sp)
axes = the_plot
else
axes = the_plot.elements[1]
end
##< handle insets ##< handle insets
# TODO: build id map for subplots like for series # TODO: build id map for subplots like for series
if sp in parents if sp in parents
@ -369,7 +365,7 @@ function (pgfx_plot::PGFPlotsXPlot)(plt::Plot{PGFPlotsXBackend})
)) ))
end end
##> ##>
push!( axes, axis ) push!( the_plot, axis )
if length(plt.o.the_plot.elements) > 0 if length(plt.o.the_plot.elements) > 0
plt.o.the_plot.elements[1] = the_plot plt.o.the_plot.elements[1] = the_plot
else else