add guard against overexecution

This commit is contained in:
Simon Christ 2019-11-15 16:41:47 +01:00
parent 86643058b6
commit 2bf3ddf45b

View File

@ -419,7 +419,13 @@ function pgfx_axis!(opt::PGFPlotsX.Options, sp::Subplot, letter)
end end
# -------------------------------------------------------------------------------------- # --------------------------------------------------------------------------------------
# display calls this and then _display, its called 3 times for plot(1:5) # 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}) function _update_plot_object(plt::Plot{PGFPlotsXBackend})
if n_calls === 0
plt.o = PGFPlotsX.GroupPlot() plt.o = PGFPlotsX.GroupPlot()
for sp in plt.subplots for sp in plt.subplots
@ -478,6 +484,8 @@ function _update_plot_object(plt::Plot{PGFPlotsXBackend})
push!( plt.o, axis ) push!( plt.o, axis )
end end
end end
n_calls += 1
end
function _show(io::IO, mime::MIME"image/svg+xml", plt::Plot{PGFPlotsXBackend}) function _show(io::IO, mime::MIME"image/svg+xml", plt::Plot{PGFPlotsXBackend})
show(io, mime, plt.o) show(io, mime, plt.o)