From f58d585a205f64b60fad96572345ab992ba4a90c Mon Sep 17 00:00:00 2001 From: Anshul Singhvi Date: Fri, 13 Dec 2019 13:47:22 -0500 Subject: [PATCH] Unify preamble pushes --- src/backends/pgfplotsx.jl | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/backends/pgfplotsx.jl b/src/backends/pgfplotsx.jl index 69c0b4b4..3987d0e9 100644 --- a/src/backends/pgfplotsx.jl +++ b/src/backends/pgfplotsx.jl @@ -6,10 +6,15 @@ Base.@kwdef mutable struct PGFPlotsXPlot function PGFPlotsXPlot(is_created, was_shown, the_plot) pgfx_plot = new(is_created, was_shown, the_plot) # tikz libraries - PGFPlotsX.push_preamble!(pgfx_plot.the_plot, "\\usetikzlibrary{arrows.meta}") - PGFPlotsX.push_preamble!(pgfx_plot.the_plot, "\\usetikzlibrary{backgrounds}") PGFPlotsX.push_preamble!(pgfx_plot.the_plot, """ + % Load TikZ libraries + \\usetikzlibrary{arrows.meta, backgrounds} + + % Load PGFPlots libraries + \\usepgfplotslibrary{patchplots, fillbetween} + + % Set some useful keys \\pgfkeys{/tikz/.cd, background color/.initial=white, background color/.get=\\backcol, @@ -25,8 +30,7 @@ Base.@kwdef mutable struct PGFPlotsXPlot """ ) # pgfplots libraries - PGFPlotsX.push_preamble!(pgfx_plot.the_plot, "\\usepgfplotslibrary{patchplots}") - PGFPlotsX.push_preamble!(pgfx_plot.the_plot, "\\usepgfplotslibrary{fillbetween}") + PGFPlotsX.push_preamble!(pgfx_plot.the_plot, "") pgfx_plot end end