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

Commitdf0051c

Browse files
committed
update mpl_toolkit function
1 parent08d5e6c commitdf0051c

File tree

1 file changed

+25
-4
lines changed

1 file changed

+25
-4
lines changed

‎control/grid.py

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,13 @@ def __call__(self, direction, factor, values):
1919

2020

2121
classModifiedExtremeFinderCycle(angle_helper.ExtremeFinderCycle):
22-
'''Changed to allow only left hand-side polar grid'''
22+
'''Changed to allow only left hand-side polar grid
23+
24+
https://matplotlib.org/_modules/mpl_toolkits/axisartist/angle_helper.html#ExtremeFinderCycle.__call__
25+
'''
2326
def__call__(self,transform_xy,x1,y1,x2,y2):
24-
x_,y_=np.linspace(x1,x2,self.nx),np.linspace(y1,y2,self.ny)
25-
x,y=np.meshgrid(x_,y_)
27+
x,y=np.meshgrid(
28+
np.linspace(x1,x2,self.nx),np.linspace(y1,y2,self.ny))
2629
lon,lat=transform_xy(np.ravel(x),np.ravel(y))
2730

2831
withnp.errstate(invalid='ignore'):
@@ -41,7 +44,25 @@ def __call__(self, transform_xy, x1, y1, x2, y2):
4144
lat_min,lat_max=np.nanmin(lat),np.nanmax(lat)
4245

4346
lon_min,lon_max,lat_min,lat_max= \
44-
self._adjust_extremes(lon_min,lon_max,lat_min,lat_max)
47+
self._add_pad(lon_min,lon_max,lat_min,lat_max)
48+
49+
# check cycle
50+
ifself.lon_cycle:
51+
lon_max=min(lon_max,lon_min+self.lon_cycle)
52+
ifself.lat_cycle:
53+
lat_max=min(lat_max,lat_min+self.lat_cycle)
54+
55+
ifself.lon_minmaxisnotNone:
56+
min0=self.lon_minmax[0]
57+
lon_min=max(min0,lon_min)
58+
max0=self.lon_minmax[1]
59+
lon_max=min(max0,lon_max)
60+
61+
ifself.lat_minmaxisnotNone:
62+
min0=self.lat_minmax[0]
63+
lat_min=max(min0,lat_min)
64+
max0=self.lat_minmax[1]
65+
lat_max=min(max0,lat_max)
4566

4667
returnlon_min,lon_max,lat_min,lat_max
4768

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp