diff --git a/src/rqt_plot/data_plot/mat_data_plot.py b/src/rqt_plot/data_plot/mat_data_plot.py index 55a6cde..0f44553 100644 --- a/src/rqt_plot/data_plot/mat_data_plot.py +++ b/src/rqt_plot/data_plot/mat_data_plot.py @@ -120,6 +120,8 @@ def safe_tight_layout(self): - https://github.com/ros-visualization/rqt_plot/issues/35 """ try: + if self.figure.get_figheight() == 0 or self.figure.get_figwidth() == 0: + return self.figure.tight_layout() except ValueError: if parse_version(matplotlib.__version__) >= parse_version('2.2.3'):