79278172

Date: 2024-12-13 11:42:39
Score: 0.5
Natty:
Report link

Arrowsize in streamplot is a single number, scales them all. How about this simple variant with more contrast ?

...
U = np.cos(X) * np.sin(Y) * np.exp(-X / 3)  # exp(-x) is too much
V = - np.sin(X) * np.cos(Y) * np.exp(-X / 3)
mag = np.sqrt(U**2 + V**2)

fig, ax = pl.subplots( figsize=[8,8] )
lw = mag / np.max(mag[10:,:])

ax.set_facecolor( "darkblue" )
stream = ax.streamplot(X, Y, U, V, linewidth=lw, color="lightyellow" )

print( 'savefig streamplot.png" )
pl.savefig( "streamplot.png" )

streamplot, darkblue background

Reasons:
  • Probably link only (1):
  • Has code block (-0.5):
  • Ends in question mark (2):
  • High reputation (-2):
Posted by: denis