@@ -142,7 +142,7 @@ def test_response_plots(
142142def test_manual_response_limits ():
143143 # Default response: limits should be the same across rows
144144 cplt = manual_response .plot ()
145- axs = ct . get_plot_axes ( cplt ) # legacy usage OK
145+ axs = cplt . axes
146146 for i in range (manual_response .noutputs ):
147147 for j in range (1 , manual_response .ninputs ):
148148 # Everything in the same row should have the same limits
@@ -305,8 +305,8 @@ def test_bode_share_options():
305305 ct .set_defaults ('freqplot' , title_frame = 'figure' )
306306
307307 # Default sharing should share along rows and cols for mag and phase
308- lines = ct .bode_plot (manual_response )
309- axs = ct . get_plot_axes ( lines )
308+ cplt = ct .bode_plot (manual_response )
309+ axs = cplt . axes
310310 for i in range (axs .shape [0 ]):
311311 for j in range (axs .shape [1 ]):
312312 # Share y limits along rows
@@ -317,8 +317,8 @@ def test_bode_share_options():
317317
318318 # Sharing along y axis for mag but not phase
319319 plt .figure ()
320- lines = ct .bode_plot (manual_response , share_phase = 'none' )
321- axs = ct . get_plot_axes ( lines )
320+ cplt = ct .bode_plot (manual_response , share_phase = 'none' )
321+ axs = cplt . axes
322322 for i in range (int (axs .shape [0 ] / 2 )):
323323 for j in range (axs .shape [1 ]):
324324 if i != 0 :
@@ -330,8 +330,8 @@ def test_bode_share_options():
330330
331331 # Turn off sharing for magnitude and phase
332332 plt .figure ()
333- lines = ct .bode_plot (manual_response , sharey = 'none' )
334- axs = ct . get_plot_axes ( lines )
333+ cplt = ct .bode_plot (manual_response , sharey = 'none' )
334+ axs = cplt . axes
335335 for i in range (int (axs .shape [0 ] / 2 )):
336336 for j in range (axs .shape [1 ]):
337337 if i != 0 :
@@ -345,7 +345,7 @@ def test_bode_share_options():
345345
346346 # Turn off sharing in x axes
347347 plt .figure ()
348- lines = ct .bode_plot (manual_response , sharex = 'none' )
348+ cplt = ct .bode_plot (manual_response , sharex = 'none' )
349349 # TODO: figure out what to check
350350
351351
@@ -355,11 +355,11 @@ def test_freqplot_plot_type(plot_type):
355355 response = ct .singular_values_response (ct .rss (2 , 1 , 1 ))
356356 else :
357357 response = ct .frequency_response (ct .rss (2 , 1 , 1 ))
358- lines = response .plot (plot_type = plot_type )
358+ cplt = response .plot (plot_type = plot_type )
359359 if plot_type == 'bode' :
360- assert lines .shape == (2 , 1 )
360+ assert cplt . lines .shape == (2 , 1 )
361361 else :
362- assert lines .shape == (1 , )
362+ assert cplt . lines .shape == (1 , )
363363
364364@pytest .mark .parametrize ("plt_fcn" , [ct .bode_plot , ct .singular_values_plot ])
365365@pytest .mark .usefixtures ("editsdefaults" )
@@ -379,14 +379,14 @@ def _get_visible_limits(ax):
379379 ct .tf ([1 ], [1 , 2 , 1 ]), np .logspace (- 1 , 1 ))
380380
381381 # Generate a plot without overridding the limits
382- lines = plt_fcn (response )
383- ax = ct . get_plot_axes ( lines )
382+ cplt = plt_fcn (response )
383+ ax = cplt . axes
384384 np .testing .assert_allclose (
385385 _get_visible_limits (ax .reshape (- 1 )[0 ]), np .array ([0.1 , 10 ]))
386386
387387 # Now reset the limits
388- lines = plt_fcn (response , omega_limits = (1 , 100 ))
389- ax = ct . get_plot_axes ( lines )
388+ cplt = plt_fcn (response , omega_limits = (1 , 100 ))
389+ ax = cplt . axes
390390 np .testing .assert_allclose (
391391 _get_visible_limits (ax .reshape (- 1 )[0 ]), np .array ([1 , 100 ]))
392392
@@ -400,7 +400,7 @@ def test_gangof4_trace_labels():
400400 # Make sure default labels are as expected
401401 cplt = ct .gangof4_response (P1 , C1 ).plot ()
402402 cplt = ct .gangof4_response (P2 , C2 ).plot ()
403- axs = ct . get_plot_axes ( cplt ) # legacy usage OK
403+ axs = cplt . axes
404404 legend = axs [0 , 1 ].get_legend ().get_texts ()
405405 assert legend [0 ].get_text () == 'P=P1, C=C1'
406406 assert legend [1 ].get_text () == 'P=P2, C=C2'
@@ -409,7 +409,7 @@ def test_gangof4_trace_labels():
409409 # Suffix truncation
410410 cplt = ct .gangof4_response (P1 , C1 ).plot ()
411411 cplt = ct .gangof4_response (P2 , C1 ).plot ()
412- axs = ct . get_plot_axes ( cplt ) # legacy usage OK
412+ axs = cplt . axes
413413 legend = axs [0 , 1 ].get_legend ().get_texts ()
414414 assert legend [0 ].get_text () == 'P=P1'
415415 assert legend [1 ].get_text () == 'P=P2'
@@ -418,7 +418,7 @@ def test_gangof4_trace_labels():
418418 # Prefix turncation
419419 cplt = ct .gangof4_response (P1 , C1 ).plot ()
420420 cplt = ct .gangof4_response (P1 , C2 ).plot ()
421- axs = ct . get_plot_axes ( cplt ) # legacy usage OK
421+ axs = cplt . axes
422422 legend = axs [0 , 1 ].get_legend ().get_texts ()
423423 assert legend [0 ].get_text () == 'C=C1'
424424 assert legend [1 ].get_text () == 'C=C2'
@@ -427,7 +427,7 @@ def test_gangof4_trace_labels():
427427 # Override labels
428428 cplt = ct .gangof4_response (P1 , C1 ).plot (label = 'xxx, line1, yyy' )
429429 cplt = ct .gangof4_response (P2 , C2 ).plot (label = 'xxx, line2, yyy' )
430- axs = ct . get_plot_axes ( cplt ) # legacy usage OK
430+ axs = cplt . axes
431431 legend = axs [0 , 1 ].get_legend ().get_texts ()
432432 assert legend [0 ].get_text () == 'xxx, line1, yyy'
433433 assert legend [1 ].get_text () == 'xxx, line2, yyy'
@@ -446,7 +446,7 @@ def test_freqplot_line_labels(plt_fcn):
446446
447447 # Make sure default labels are as expected
448448 cplt = plt_fcn ([sys1 , sys2 ])
449- axs = ct . get_plot_axes ( cplt ) # legacy usage OK
449+ axs = cplt . axes
450450 if axs .ndim == 1 :
451451 legend = axs [0 ].get_legend ().get_texts ()
452452 else :
@@ -457,7 +457,7 @@ def test_freqplot_line_labels(plt_fcn):
457457
458458 # Override labels all at once
459459 cplt = plt_fcn ([sys1 , sys2 ], label = ['line1' , 'line2' ])
460- axs = ct . get_plot_axes ( cplt ) # legacy usage OK
460+ axs = cplt . axes
461461 if axs .ndim == 1 :
462462 legend = axs [0 ].get_legend ().get_texts ()
463463 else :
@@ -469,7 +469,7 @@ def test_freqplot_line_labels(plt_fcn):
469469 # Override labels one at a time
470470 cplt = plt_fcn (sys1 , label = 'line1' )
471471 cplt = plt_fcn (sys2 , label = 'line2' )
472- axs = ct . get_plot_axes ( cplt ) # legacy usage OK
472+ axs = cplt . axes
473473 if axs .ndim == 1 :
474474 legend = axs [0 ].get_legend ().get_texts ()
475475 else :
@@ -495,7 +495,7 @@ def test_line_labels_bode(kwargs, labels):
495495 ct .bode_plot ([sys1 , sys2 ], label = ['line1' ])
496496
497497 cplt = ct .bode_plot ([sys1 , sys2 ], label = labels , ** kwargs )
498- axs = ct . get_plot_axes ( cplt ) # legacy usage OK
498+ axs = cplt . axes
499499 legend_texts = axs [0 , - 1 ].get_legend ().get_texts ()
500500 for i , legend in enumerate (legend_texts ):
501501 assert legend .get_text () == labels [i ]
@@ -524,7 +524,7 @@ def test_freqplot_ax_keyword(plt_fcn, ninputs, noutputs):
524524 cplt1 = plt_fcn (sys )
525525
526526 # Draw again on the same figure, using array
527- axs = ct . get_plot_axes ( cplt1 ) # legacy usage OK
527+ axs = cplt1 . axes
528528 cplt2 = plt_fcn (sys , ax = axs )
529529 np .testing .assert_equal (cplt1 .axes , cplt2 .axes )
530530
0 commit comments