From 7a6d546b5ef48dc73fb492b14e523bb2859f12b2 Mon Sep 17 00:00:00 2001 From: Simon Christ Date: Fri, 10 Jan 2020 22:22:44 +0100 Subject: [PATCH] insets resp. to window --- src/backends/pgfplotsx.jl | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/backends/pgfplotsx.jl b/src/backends/pgfplotsx.jl index 22cf58a6..869ef18a 100644 --- a/src/backends/pgfplotsx.jl +++ b/src/backends/pgfplotsx.jl @@ -77,8 +77,8 @@ end function (pgfx_plot::PGFPlotsXPlot)(plt::Plot{PGFPlotsXBackend}) if !pgfx_plot.is_created the_plot = PGFPlotsX.TikzPicture(PGFPlotsX.Options()) - bgc = plt.attr[:background_color_outside] == :match ? - plt.attr[:background_color] : plt.attr[:background_color_outside] + # rows, cols = size(plt.layout.grid) + bgc = plt.attr[:background_color_outside] == :match ? plt.attr[:background_color] : plt.attr[:background_color_outside] if bgc isa Colors.Colorant cstr = plot_color(bgc) a = alpha(cstr) @@ -354,7 +354,10 @@ function (pgfx_plot::PGFPlotsXPlot)(plt::Plot{PGFPlotsXBackend}) if sp in inset_subplots dx, dy = sp.bbox.x0 push!(axis.options, - "at" => "($(_pgfplotsx_subplot_ids[Symbol(string(sp.parent[:subplot_index]))]).north west)", + "at" => sp.parent isa Subplot ? + "($(_pgfplotsx_subplot_ids[Symbol(string(sp.parent[:subplot_index]))]).north west)" + : + "(current bounding box.north west)", "anchor" => "outer north west", "xshift" => string(dx), "yshift" => string(-dy)