From 67154d4f18511f5fd34483af69e27a4677c54432 Mon Sep 17 00:00:00 2001 From: Simon Christ Date: Fri, 29 Oct 2021 11:27:07 +0200 Subject: [PATCH] support axis flip --- src/recipes.jl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/recipes.jl b/src/recipes.jl index 87309fbe..9df165e5 100644 --- a/src/recipes.jl +++ b/src/recipes.jl @@ -1037,14 +1037,14 @@ export lens! throw(ArgumentError("Inset bounding box needs to in relative coordinates.")) end sp = plt.subplots[sp_index] - xl1, xl2 = xlims(plt.subplots[sp_index]) + xl1, xl2 = xlims(sp) bbx1 = xl1 + left(inset_bbox).value * (xl2 - xl1) bbx2 = bbx1 + width(inset_bbox).value * (xl2 - xl1) - yl1, yl2 = ylims(plt.subplots[sp_index]) + yl1, yl2 = ylims(sp) bby1 = yl1 + (1 - bottom(inset_bbox).value) * (yl2 - yl1) bby2 = bby1 + height(inset_bbox).value * (yl2 - yl1) - bbx = bbx1 + width(inset_bbox).value * (xl2 - xl1) / 2 - bby = bby1 + height(inset_bbox).value * (yl2 - yl1) / 2 + bbx = bbx1 + width(inset_bbox).value * (xl2 - xl1) / 2 * (sp[:xaxis][:flip] ? -1 : 1) + bby = bby1 + height(inset_bbox).value * (yl2 - yl1) / 2 * (sp[:yaxis][:flip] ? -1 : 1) lens_index = last(plt.subplots)[:subplot_index] + 1 x1, x2 = plotattributes[:x] y1, y2 = plotattributes[:y]