Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite7ca3a3

Browse files
committed
Merge pull request#789 from tonysyu/fix-streamplot
Fix streamplot for non-square grids.
2 parentsec1cd25 +dbc4324 commite7ca3a3

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

‎lib/matplotlib/streamplot.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
importnumpyasnp
66
importmatplotlib
77
importmatplotlib.patchesaspatches
8-
importmatplotlib.cbookascbook
98

109

1110
__all__= ['streamplot']
@@ -332,9 +331,11 @@ def backward_time(xi, yi):
332331
return-dxi,-dyi
333332

334333
defintegrate(x0,y0):
335-
"""Return x, y coordinates of trajectory based on starting point.
334+
"""Return x, y grid-coordinates of trajectory based on starting point.
335+
336+
Integrate both forward and backward in time from starting point in
337+
grid coordinates.
336338
337-
Integrate both forward and backward in time from starting point.
338339
Integration is terminated when a trajectory reaches a domain boundary
339340
or when it crosses into an already occupied cell in the StreamMask. The
340341
resulting trajectory is None if it is shorter than `minlength`.
@@ -446,10 +447,10 @@ def _integrate_rk12(x0, y0, dmap, f):
446447

447448
def_euler_step(xf_traj,yf_traj,dmap,f):
448449
"""Simple Euler integration step."""
449-
nx,ny=dmap.grid.shape
450+
ny,nx=dmap.grid.shape
450451
xi=xf_traj[-1]
451452
yi=yf_traj[-1]
452-
cx,cy=f(xi,yi)# ds.cx is in data coordinates, ds in axis coord.
453+
cx,cy=f(xi,yi)
453454
ifcx>0:
454455
dsx= (nx-1-xi)/cx
455456
else:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp