@@ -186,11 +186,13 @@ def test_root_locus_documentation(savefigs=False):
186186 sys = ct .tf ([1 , 2 ], [1 , 2 , 3 ], name = 'SISO transfer function' )
187187 response = ct .pole_zero_map (sys )
188188 ct .pole_zero_plot (response )
189- plt .savefig ('pzmap-siso_ctime-default.png' )
189+ if savefigs :
190+ plt .savefig ('pzmap-siso_ctime-default.png' )
190191
191192 plt .figure ()
192193 ct .root_locus_map (sys ).plot ()
193- plt .savefig ('rlocus-siso_ctime-default.png' )
194+ if savefigs :
195+ plt .savefig ('rlocus-siso_ctime-default.png' )
194196
195197 # TODO: generate event in order to generate real title
196198 plt .figure ()
@@ -200,18 +202,21 @@ def test_root_locus_documentation(savefigs=False):
200202 with plt .rc_context (freqplot_rcParams ):
201203 ax .set_title (
202204 "Clicked at: -2.729+1.511j gain = 3.506 damping = 0.8748" )
203- plt .savefig ('rlocus-siso_ctime-clicked.png' )
205+ if savefigs :
206+ plt .savefig ('rlocus-siso_ctime-clicked.png' )
204207
205208 plt .figure ()
206209 sysd = sys .sample (0.1 )
207210 ct .root_locus_plot (sysd )
208- plt .savefig ('rlocus-siso_dtime-default.png' )
211+ if savefigs :
212+ plt .savefig ('rlocus-siso_dtime-default.png' )
209213
210214 plt .figure ()
211215 sys1 = ct .tf ([1 , 2 ], [1 , 2 , 3 ], name = 'sys1' )
212216 sys2 = ct .tf ([1 , 0.2 ], [1 , 1 , 3 , 1 , 1 ], name = 'sys2' )
213217 ct .root_locus_plot ([sys1 , sys2 ], grid = False )
214- plt .savefig ('rlocus-siso_multiple-nogrid.png' )
218+ if savefigs :
219+ plt .savefig ('rlocus-siso_multiple-nogrid.png' )
215220
216221
217222if __name__ == "__main__" :
0 commit comments