@@ -170,7 +170,8 @@ def invpend_ode(t, x, m=0, l=0, b=0, g=0):
170
170
plot_streamlines = True )
171
171
172
172
with pytest .raises (ValueError , match = "gridtype must be 'meshgrid' when using streamplot" ):
173
- ct .phase_plane_plot (ct .rss (2 , 1 , 1 ), plot_streamplot = True , gridtype = 'boxgrid' )
173
+ ct .phase_plane_plot (ct .rss (2 , 1 , 1 ), plot_streamlines = False ,
174
+ plot_streamplot = True , gridtype = 'boxgrid' )
174
175
175
176
# Warning messages for invalid solutions: nonlinear spring mass system
176
177
sys = ct .nlsys (
@@ -220,7 +221,8 @@ def assert_orders(streamlines, quiver, streamplot, separatrices, equilpoints):
220
221
if streamplot is not None :
221
222
assert streamplot < separatrices < equilpoints
222
223
223
- sys = ct .rss (2 , 1 , 1 )
224
+ def sys (t , x ):
225
+ return np .array ([4 * x [1 ], - np .sin (4 * x [0 ])])
224
226
225
227
# ensure correct zordering for all three flow types
226
228
res_streamlines = ct .phase_plane_plot (sys , plot_streamlines = dict (color = key_color ))
@@ -239,7 +241,9 @@ def assert_orders(streamlines, quiver, streamplot, separatrices, equilpoints):
239
241
240
242
@pytest .mark .usefixtures ('mplcleanup' )
241
243
def test_stream_plot_magnitude ():
242
- sys = ct .rss (2 , 1 , 1 )
244
+ def sys (t , x ):
245
+ return np .array ([4 * x [1 ], - np .sin (4 * x [0 ])])
246
+
243
247
# plt context with linewidth
244
248
with plt .rc_context ({'lines.linewidth' : 4 }):
245
249
res = ct .phase_plane_plot (sys , plot_streamplot = dict (vary_linewidth = True ))
0 commit comments