add guard against overexecution

This commit is contained in:
Simon Christ 2019-11-15 16:41:47 +01:00
parent 9fb6b8059f
commit 7f1863f3b9

View File

@ -425,7 +425,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
@ -509,6 +515,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)