Skip to content

Commit 1f702f6

Browse files
committed
check for legacy usage of phase_plane_plot that expects plot_streamlines to be the default
1 parent 7a0c8f2 commit 1f702f6

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

control/phaseplot.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,21 @@ def phase_plane_plot(
159159
Set the title of the plot. Defaults to plot type and system name(s).
160160
161161
"""
162+
# Check for legacy usage of plot_streamlines
163+
streamline_keywords = [
164+
'arrows', 'arrow_size', 'arrow_style', 'color', 'dir', 'params']
165+
if plot_streamlines is None:
166+
if any([kw in kwargs for kw in streamline_keywords]):
167+
warnings.warn(
168+
"detected streamline keywords; use plot_streamlines to set",
169+
FutureWarning)
170+
plot_streamlines = True
171+
if gridtype not in [None, 'meshgrid']:
172+
warnings.warn(
173+
"streamplots only support gridtype='meshgrid'; "
174+
"falling back to streamlines")
175+
plot_streamlines = True
176+
162177
if (
163178
plot_streamlines is None
164179
and plot_vectorfield is None

0 commit comments

Comments
 (0)