From 1cc0f093995906b3aabce6033faca1a7f30b1d2e Mon Sep 17 00:00:00 2001 From: Noe Brucy Date: Mon, 20 Sep 2021 11:01:37 +0200 Subject: [PATCH] [plotter] do not allow overlays to change limits --- plotter.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plotter.py b/plotter.py index 978450c..a201815 100644 --- a/plotter.py +++ b/plotter.py @@ -686,11 +686,16 @@ class Plotter(Aggregator, BaseProcessor): ) else: plot_overlay = self.overlays[plot_overlay] + xlim = plt.xlim() + ylim = plt.ylim() try: plot_overlay(ax_los, im_extent, **overlays_kwargs[i]) except IndexError: plot_overlay(ax_los, im_extent) - + finally: + # Restore previous limits in case overlays changed it + plt.xlim(xlim) + plt.ylim(ylim) if embeded: plt.subplots_adjust(left=0, right=1, top=1, bottom=0)