Skip to content

Commit 0de202f

Browse files
committed
Proj() bugfix
1 parent 5493f61 commit 0de202f

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

proplot/projs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,9 @@ def Proj(name, basemap=False, **kwargs):
147147
if ((CRS is not object and isinstance(name, CRS))
148148
or (Basemap is not object and isinstance(name, Basemap))):
149149
proj = name
150-
elif not isinstance(proj, str):
150+
elif not isinstance(name, str):
151151
raise ValueError(
152-
f'Unexpected Proj() argument {proj!r}. '
152+
f'Unexpected Proj() argument {name!r}. '
153153
'Must be name, mpl_toolkits.basemap.Basemap instance, '
154154
'or cartopy.crs.CRS instance.'
155155
)

proplot/subplots.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2249,21 +2249,19 @@ def subplots(
22492249
# Custom Basemap and Cartopy axes
22502250
else:
22512251
package = 'basemap' if basemap[num] else 'geo'
2252-
obj = projs.Proj(
2252+
m = projs.Proj(
22532253
name, basemap=basemap[num], **proj_kw[num]
22542254
)
22552255
if num == ref:
22562256
if basemap[num]:
22572257
aspect = (
2258-
(proj.urcrnrx - proj.llcrnrx)
2259-
/ (proj.urcrnry - proj.llcrnry)
2258+
(m.urcrnrx - m.llcrnrx) / (m.urcrnry - m.llcrnry)
22602259
)
22612260
else:
22622261
aspect = (
2263-
np.diff(proj.x_limits)
2264-
/ np.diff(proj.y_limits)
2262+
np.diff(m.x_limits) / np.diff(m.y_limits)
22652263
)[0]
2266-
axes_kw[num].update({'projection': package, 'map_projection': obj})
2264+
axes_kw[num].update({'projection': package, 'map_projection': m})
22672265

22682266
# Figure and/or axes dimensions
22692267
names, values = (), ()

0 commit comments

Comments
 (0)