47
47
48
48
def phase_plane_plot (
49
49
sys , pointdata = None , timedata = None , gridtype = None , gridspec = None ,
50
- plot_streamlines = True , plot_vectorfield = False , plot_equilpoints = True ,
51
- plot_separatrices = True , ax = None , suppress_warnings = False , title = None ,
52
- plot_streamplot = False , ** kwargs
50
+ plot_streamlines = None , plot_vectorfield = None , plot_streamplot = None ,
51
+ plot_equilpoints = True , plot_separatrices = True , ax = None ,
52
+ suppress_warnings = False , title = None , ** kwargs
53
53
):
54
54
"""Plot phase plane diagram.
55
55
56
56
This function plots phase plane data, including vector fields, stream
57
57
lines, equilibrium points, and contour curves.
58
+ If none of plot_streamlines, plot_vectorfield, or plot_streamplot are
59
+ set, then plot_streamlines is used by default.
58
60
59
61
Parameters
60
62
----------
@@ -129,15 +131,15 @@ def phase_plane_plot(
129
131
'both' to flow both forward and backward. The amount of time to
130
132
simulate in each direction is given by the `timedata` argument.
131
133
plot_streamlines : bool or dict, optional
132
- If True (default) then plot streamlines based on the pointdata
133
- and gridtype. If set to a dict, pass on the key-value pairs in
134
- the dict as keywords to `streamlines`.
134
+ If then plot streamlines based on the pointdata and gridtype. If set
135
+ to a dict, pass on the key-value pairs in the dict as keywords to
136
+ `streamlines`.
135
137
plot_vectorfield : bool or dict, optional
136
- If True (default) then plot the vector field based on the pointdata
137
- and gridtype. If set to a dict, pass on the key-value pairs in
138
- the dict as keywords to `phaseplot.vectorfield`.
138
+ If then plot the vector field based on the pointdata and gridtype.
139
+ If set to a dict, pass on the key-value pairs in the dict as keywords
140
+ to `phaseplot.vectorfield`.
139
141
plot_streamplot : bool or dict, optional
140
- If True then use :func:`matplotlib.axes.Axes.streamplot` function
142
+ If then use :func:`matplotlib.axes.Axes.streamplot` function
141
143
to plot the streamlines. If set to a dict, pass on the key-value
142
144
pairs in the dict as keywords to :func:`~control.phaseplot.streamplot`.
143
145
plot_equilpoints : bool or dict, optional
@@ -157,6 +159,16 @@ def phase_plane_plot(
157
159
Set the title of the plot. Defaults to plot type and system name(s).
158
160
159
161
"""
162
+ if (
163
+ plot_streamlines is None
164
+ and plot_vectorfield is None
165
+ and plot_streamplot is None
166
+ ):
167
+ plot_streamlines = True
168
+
169
+ if plot_streamplot and not plot_streamlines and not plot_vectorfield :
170
+ gridspec = gridspec or [25 , 25 ]
171
+
160
172
# Process arguments
161
173
params = kwargs .get ('params' , None )
162
174
sys = _create_system (sys , params )
@@ -378,20 +390,20 @@ def streamplot(
378
390
Plot the vector field in the given color.
379
391
vary_color : bool, optional
380
392
If set to True, vary the color of the streamlines based on the magnitude
381
- vary_linewidth : bool, optional
382
- If set to True, vary the linewidth of the streamlines based on the magnitude
393
+ vary_linewidth : bool, optional.
394
+ If set to True, vary the linewidth of the streamlines based on the magnitude.
383
395
cmap : str or Colormap, optional
384
- Colormap to use for varying the color of the streamlines
396
+ Colormap to use for varying the color of the streamlines.
385
397
norm : `matplotlib.colors.Normalize`, optional
386
- An instance of Normalize to use for scaling the colormap and linewidths
398
+ An instance of Normalize to use for scaling the colormap and linewidths.
387
399
ax : `matplotlib.axes.Axes`, optional
388
400
Use the given axes for the plot, otherwise use the current axes.
389
401
390
402
Returns
391
403
-------
392
404
out : StreamplotSet
393
405
394
- Other parameters
406
+ Other Parameters
395
407
----------------
396
408
rcParams : dict
397
409
Override the default parameters used for generating plots.
0 commit comments