From eddf523d084328fbebe16375bc503525f5eb1b4d Mon Sep 17 00:00:00 2001 From: Simon Christ Date: Wed, 13 Nov 2019 12:12:31 +0100 Subject: [PATCH] fix display --- src/backends/pgfplotsx.jl | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/backends/pgfplotsx.jl b/src/backends/pgfplotsx.jl index e85e0933..a62f2317 100644 --- a/src/backends/pgfplotsx.jl +++ b/src/backends/pgfplotsx.jl @@ -1,9 +1,18 @@ using PGFPlotsX: PGFPlotsX # -------------------------------------------------------------------------------------- -# display calls this and then _display +# display calls this and then _display, its called 3 times for plot(1:5) function _update_plot_object(plt::Plot{PGFPlotsXBackend}) - plt.o = PGFPlotsX.Axis() - push!( plt.o, PGFPlotsX.Plot(PGFPlotsX.Coordinates(1:5,1:5)) ) + plt.o = PGFPlotsX.GroupPlot() + + local axis + for sp in plt.subplots + axis = PGFPlotsX.Axis() + for series in series_list(sp) + series_plot = PGFPlotsX.Plot(PGFPlotsX.Coordinates(series[:x],series[:y])) + push!( axis, series_plot ) + end + end + push!( plt.o, axis ) end function _show(io::IO, mime::MIME"image/svg+xml", plt::Plot{PGFPlotsXBackend}) @@ -23,5 +32,8 @@ function _show(io::IO, mime::MIME"application/x-tex", plt::Plot{PGFPlotsXBackend end function _display(plt::Plot{PGFPlotsXBackend}) + # fn = string(tempname(),".svg") + # PGFPlotsX.pgfsave(fn, plt.o) + # open_browser_window(fn) plt.o end