Skip to content

Commit bb7e8be

Browse files
author
Daniel Ruprecht
committed
fixes stability plot for K=0
1 parent df4af86 commit bb7e8be

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

examples/fwsw/plot_stability.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
nnodes = step.levels[0].sweep.coll.num_nodes
5050
level = step.levels[0]
5151
problem = level.prob
52+
Q = level.sweep.coll.Qmat[1:,1:]
5253

5354
stab = np.zeros((N_f, N_s), dtype='complex')
5455

@@ -84,7 +85,8 @@
8485
CS2 = plt.contour(lambda_s.imag, lambda_f.imag, np.absolute(stab), [1.0], colors='k')
8586
plt.clabel(CS1, inline=True, fmt='%3.2f', fontsize=fs-2)
8687
manual_locations = [(1.5, 2.5)]
87-
plt.clabel(CS2, inline=True, fmt='%3.2f', fontsize=fs-2, manual=manual_locations)
88+
if K>0: # for K=0 and no 1.0 isoline, this crashes Matplotlib for somer reason
89+
plt.clabel(CS2, inline=True, fmt='%3.2f', fontsize=fs-2, manual=manual_locations)
8890
plt.gca().add_patch(Polygon([[0, 0], [lam_s_max,0], [lam_s_max,lam_s_max]], visible=True, fill=True, facecolor='.75',edgecolor='k', linewidth=1.0, zorder=11))
8991
#plt.plot([0, 2], [0, 2], color='k', linewidth=1, zorder=12)
9092
plt.gca().set_xticks(np.arange(0, int(lam_s_max)+1))

0 commit comments

Comments
 (0)