From 2bf3ddf45b062de7fe164d3a638b63729d58f894 Mon Sep 17 00:00:00 2001 From: Simon Christ Date: Fri, 15 Nov 2019 16:41:47 +0100 Subject: [PATCH] add guard against overexecution --- src/backends/pgfplotsx.jl | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/backends/pgfplotsx.jl b/src/backends/pgfplotsx.jl index becb538a..228b3ea3 100644 --- a/src/backends/pgfplotsx.jl +++ b/src/backends/pgfplotsx.jl @@ -419,7 +419,13 @@ function pgfx_axis!(opt::PGFPlotsX.Options, sp::Subplot, letter) end # -------------------------------------------------------------------------------------- # display calls this and then _display, its called 3 times for plot(1:5) +let n_calls = 0 +function _series_updated(plt::Plot{PGFPlotsXBackend}, series::Series) + n_calls = 0 +end + function _update_plot_object(plt::Plot{PGFPlotsXBackend}) +if n_calls === 0 plt.o = PGFPlotsX.GroupPlot() for sp in plt.subplots @@ -478,6 +484,8 @@ function _update_plot_object(plt::Plot{PGFPlotsXBackend}) push!( plt.o, axis ) end end +n_calls += 1 +end function _show(io::IO, mime::MIME"image/svg+xml", plt::Plot{PGFPlotsXBackend}) show(io, mime, plt.o)