@@ -74,7 +74,6 @@ def setup_plot_arguments(resp_fcn, plot_fcn, compute_time_response=True):
7474 case ct .gangof4_response , _:
7575 args1 = (sys1 , sys1c )
7676 args2 = (sys2 , sys1c )
77- default_labels = ["P=sys[1]" , "P=sys[2]" ]
7877
7978 case ct .frequency_response , ct .nichols_plot :
8079 args1 = (sys1 , None ) # to allow *fmt in linestyle test
@@ -239,10 +238,10 @@ def test_plot_ax_processing(resp_fcn, plot_fcn):
239238 # Call the plotting function, passing the axes
240239 if resp_fcn is not None :
241240 resp = resp_fcn (* args , ** kwargs , ** resp_kwargs )
242- cplt4 = resp .plot (** kwargs , ** meth_kwargs , ax = ax )
241+ resp .plot (** kwargs , ** meth_kwargs , ax = ax )
243242 else :
244243 # No response function available; just plot the data
245- cplt4 = plot_fcn (* args , ** kwargs , ** plot_kwargs , ax = ax )
244+ plot_fcn (* args , ** kwargs , ** plot_kwargs , ax = ax )
246245
247246 # Check to make sure original settings did not change
248247 assert fig ._suptitle .get_text () == title
@@ -331,19 +330,9 @@ def test_plot_label_processing(resp_fcn, plot_fcn):
331330@pytest .mark .parametrize ("resp_fcn, plot_fcn" , resp_plot_fcns )
332331@pytest .mark .usefixtures ('mplcleanup' )
333332def test_plot_linestyle_processing (resp_fcn , plot_fcn ):
334- # Create some systems to use
335- sys1 = ct .rss (2 , 1 , 1 , strictly_proper = True , name = "sys[1]" )
336- sys1c = ct .rss (4 , 1 , 1 , strictly_proper = True , name = "sys[1]_C" )
337- sys2 = ct .rss (4 , 1 , 1 , strictly_proper = True , name = "sys[2]" )
338-
339333 # Set up arguments
340334 args1 , args2 , _ , kwargs , meth_kwargs , plot_kwargs , resp_kwargs = \
341335 setup_plot_arguments (resp_fcn , plot_fcn )
342- default_labels = ["sys[1]" , "sys[2]" ]
343- expected_labels = ["sys1_" , "sys2_" ]
344- match resp_fcn , plot_fcn :
345- case ct .gangof4_response , _:
346- default_labels = ["P=sys[1]" , "P=sys[2]" ]
347336
348337 # Set line color
349338 cplt1 = plot_fcn (* args1 , ** kwargs , ** plot_kwargs , color = 'r' )
@@ -491,16 +480,10 @@ def test_mimo_plot_legend_processing(resp_fcn, plot_fcn):
491480@pytest .mark .parametrize ("resp_fcn, plot_fcn" , resp_plot_fcns )
492481@pytest .mark .usefixtures ('mplcleanup' )
493482def test_plot_title_processing (resp_fcn , plot_fcn ):
494- # Create some systems to use
495- sys1 = ct .rss (2 , 1 , 1 , strictly_proper = True , name = "sys[1]" )
496- sys1c = ct .rss (4 , 1 , 1 , strictly_proper = True , name = "sys[1]_C" )
497- sys2 = ct .rss (2 , 1 , 1 , strictly_proper = True , name = "sys[2]" )
498-
499483 # Set up arguments
500484 args1 , args2 , argsc , kwargs , meth_kwargs , plot_kwargs , resp_kwargs = \
501485 setup_plot_arguments (resp_fcn , plot_fcn )
502486 default_title = "sys[1], sys[2]"
503- expected_title = "sys1_, sys2_"
504487 match resp_fcn , plot_fcn :
505488 case ct .gangof4_response , _:
506489 default_title = "P=sys[1], C=sys[1]_C, P=sys[2], C=sys[1]_C"
@@ -536,7 +519,7 @@ def test_plot_title_processing(resp_fcn, plot_fcn):
536519 case ct .input_output_response , _:
537520 title_prefix = "Input/output response for "
538521 case _:
539- raise RuntimeError (f"didn't recognize { resp_fnc } , { plot_fnc } " )
522+ raise RuntimeError (f"didn't recognize { resp_fcn } , { plot_fcn } " )
540523
541524 # Generate the first plot, with default title
542525 cplt1 = plot_fcn (* args1 , ** kwargs , ** plot_kwargs )
@@ -587,11 +570,9 @@ def test_plot_title_processing(resp_fcn, plot_fcn):
587570@pytest .mark .usefixtures ('mplcleanup' )
588571def test_tickmark_label_processing (plot_fcn ):
589572 # Generate the response that we will use for plotting
590- top_row , bot_row = 0 , - 1
591573 match plot_fcn :
592574 case ct .bode_plot :
593575 resp = ct .frequency_response (ct .rss (4 , 2 , 2 ))
594- top_row = 1
595576 case ct .time_response_plot :
596577 resp = ct .step_response (ct .rss (4 , 2 , 2 ))
597578 case ct .gangof4_plot :
@@ -625,20 +606,9 @@ def test_tickmark_label_processing(plot_fcn):
625606@pytest .mark .parametrize ("resp_fcn, plot_fcn" , resp_plot_fcns )
626607@pytest .mark .usefixtures ('mplcleanup' , 'editsdefaults' )
627608def test_rcParams (resp_fcn , plot_fcn ):
628- # Create some systems to use
629- sys1 = ct .rss (2 , 1 , 1 , strictly_proper = True , name = "sys[1]" )
630- sys1c = ct .rss (4 , 1 , 1 , strictly_proper = True , name = "sys[1]_C" )
631- sys2 = ct .rss (2 , 1 , 1 , strictly_proper = True , name = "sys[2]" )
632-
633609 # Set up arguments
634610 args1 , args2 , argsc , kwargs , meth_kwargs , plot_kwargs , resp_kwargs = \
635611 setup_plot_arguments (resp_fcn , plot_fcn )
636- default_title = "sys[1], sys[2]"
637- expected_title = "sys1_, sys2_"
638- match resp_fcn , plot_fcn :
639- case ct .gangof4_response , _:
640- default_title = "P=sys[1], C=sys[1]_C, P=sys[2], C=sys[1]_C"
641-
642612 # Create new set of rcParams
643613 my_rcParams = {}
644614 for key in ct .ctrlplot .rcParams :
0 commit comments