File tree 1 file changed +10
-10
lines changed
src/napari_matplotlib/tests
1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change 1
- from copy import deepcopy
2
-
3
1
import napari
4
2
import numpy as np
5
3
import pytest
@@ -110,11 +108,13 @@ def test_no_theme_side_effects(make_napari_viewer):
110
108
111
109
# some plotting unrelated to napari-matplotlib
112
110
image = np .random .random ((3 , 3 ))
113
- plt .imshow (image )
114
- plt .xlabel ("something unrelated to napari (x)" )
115
- plt .ylabel ("something unrelated to napari (y)" )
116
- plt .title ("this plot style should not change with napari styles or themes" )
117
- plt .tight_layout ()
118
- unrelated_figure = plt .gcf ()
119
-
120
- return deepcopy (unrelated_figure )
111
+ unrelated_figure , ax = plt .subplots ()
112
+ ax .imshow (image )
113
+ ax .set_xlabel ("something unrelated to napari (x)" )
114
+ ax .set_ylabel ("something unrelated to napari (y)" )
115
+ ax .set_title (
116
+ "this plot style should not change with napari styles or themes"
117
+ )
118
+ unrelated_figure .tight_layout ()
119
+
120
+ return unrelated_figure
You can’t perform that action at this time.
0 commit comments