File tree Expand file tree Collapse file tree 2 files changed +23
-3
lines changed
Expand file tree Collapse file tree 2 files changed +23
-3
lines changed Original file line number Diff line number Diff line change 11import inspect
2- from inspect import signature
32
43
54def dynamic_doc_string (** kwargs ):
65 def convert (func ):
76 default_vals = {
8- k : v .default for k , v in signature (func ).parameters .items ()
7+ k : v .default for k , v in inspect . signature (func ).parameters .items ()
98 if (v .default is not inspect .Parameter .empty )
109 }
1110 default_vals .update (kwargs )
Original file line number Diff line number Diff line change 11import numpy as np
22import matplotlib .pyplot as plt
33from matplotlib .testing .decorators import check_figures_equal
4- from matplotview import view , inset_zoom_axes
4+ from matplotview import view , inset_zoom_axes , stop_viewing
55
66
77@check_figures_equal (tol = 6 )
@@ -219,3 +219,24 @@ def test_double_view(fig_test, fig_ref):
219219 ax .set_aspect (1 )
220220 ax .relim ()
221221 ax .autoscale_view ()
222+
223+
224+ @check_figures_equal ()
225+ def test_stop_viewing (fig_test , fig_ref ):
226+ np .random .seed (1 )
227+ data = np .random .randint (0 , 10 , 10 )
228+
229+ # Test case... Create a view and stop it...
230+ ax1_test , ax2_test = fig_test .subplots (1 , 2 )
231+
232+ ax1_test .plot (data )
233+ ax1_test .text (0.5 , 0.5 , "Hello" )
234+
235+ view (ax2_test , ax1_test )
236+ stop_viewing (ax2_test , ax1_test )
237+
238+ # Reference, just don't plot anything at all in the second axes...
239+ ax1_ref , ax2_ref = fig_ref .subplots (1 , 2 )
240+
241+ ax1_ref .plot (data )
242+ ax1_ref .text (0.5 , 0.5 , "Hello" )
You can’t perform that action at this time.
0 commit comments