From 16e26d9b54f9b784dfda29f8d413a08f0c1c9a50 Mon Sep 17 00:00:00 2001 From: James Marshall Date: Mon, 30 Sep 2019 14:06:47 +0100 Subject: [PATCH] Workaround for #355 --- mumot/views.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/mumot/views.py b/mumot/views.py index 6639419..969ebe5 100644 --- a/mumot/views.py +++ b/mumot/views.py @@ -32,7 +32,7 @@ symbols, ) from sympy.parsing.latex import parse_latex -from warnings import warn +from warnings import warn, catch_warnings, simplefilter from . import ( consts, @@ -544,11 +544,13 @@ def _plot(self, _=None) -> None: else: # subplotNum = 1 for func, subPlotNum, axes3d in self._controller._replotFunctions: - if axes3d: - # self._figure.add_subplot(self._numRows, self._numColumns, subPlotNum, projection = '3d') - plt.subplot(self._numRows, self._numColumns, subPlotNum, projection='3d') - else: - plt.subplot(self._numRows, self._numColumns, subPlotNum) + with catch_warnings(): + simplefilter("ignore") + if axes3d: + # self._figure.add_subplot(self._numRows, self._numColumns, subPlotNum, projection = '3d') + plt.subplot(self._numRows, self._numColumns, subPlotNum, projection='3d') + else: + plt.subplot(self._numRows, self._numColumns, subPlotNum) func() plt.subplots_adjust(left=0.12, bottom=0.25, right=0.98, top=0.9, wspace=0.45, hspace=None) # plt.tight_layout()