[plotter] do not allow overlays to change limits

This commit is contained in:
Noe Brucy
2021-09-20 11:01:37 +02:00
parent fbf02ba51f
commit 1cc0f09399
+6 -1
View File
@@ -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)