Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix phase plot lines output #1066

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions control/phaseplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -532,8 +532,7 @@ def equilpoints(
out = []
for xeq in equilpts:
with plt.rc_context(rcParams):
out.append(
ax.plot(xeq[0], xeq[1], marker='o', color=color))
out += ax.plot(xeq[0], xeq[1], marker='o', color=color)
return out


Expand Down Expand Up @@ -649,8 +648,7 @@ def separatrices(
for i, xeq in enumerate(equilpts):
# Plot the equilibrium points
with plt.rc_context(rcParams):
out.append(
ax.plot(xeq[0], xeq[1], marker='o', color='k'))
out += ax.plot(xeq[0], xeq[1], marker='o', color='k')

# Figure out the linearization and eigenvectors
evals, evecs = np.linalg.eig(sys.linearize(xeq, 0, params=params).A)
Expand Down Expand Up @@ -691,13 +689,13 @@ def separatrices(
# Plot the trajectory (if there is one)
if traj.shape[1] > 1:
with plt.rc_context(rcParams):
out.append(ax.plot(
traj[0], traj[1], color=color, linestyle=linestyle))
out += ax.plot(
traj[0], traj[1], color=color, linestyle=linestyle)

# Add arrows to the lines at specified intervals
with plt.rc_context(rcParams):
_add_arrows_to_line2D(
ax, out[-1][0], arrow_pos, arrowstyle=arrow_style,
ax, out[-1], arrow_pos, arrowstyle=arrow_style,
dir=1)
return out

Expand Down
Loading