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

Appearance settings

Commit e5b0042

Browse filesBrowse files
committed
Merge pull request #1555 from joferkington/fix-geo-projections-py3k
Geo projections getting clobbered by 2to3 when used when python3
2 parents 267fb6b + 5fb0a57 commit e5b0042
Copy full SHA for e5b0042

File tree

Expand file treeCollapse file tree

2 files changed

+10
-10
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+10
-10
lines changed

‎examples/api/custom_projection_example.py

Copy file name to clipboardExpand all lines: examples/api/custom_projection_example.py
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -262,25 +262,25 @@ def set_xlim(self, *args, **kwargs):
262262
Axes.set_ylim(self, -np.pi / 2.0, np.pi / 2.0)
263263
set_ylim = set_xlim
264264

265-
def format_coord(self, long, lat):
265+
def format_coord(self, lon, lat):
266266
"""
267267
Override this method to change how the values are displayed in
268268
the status bar.
269269
270270
In this case, we want them to be displayed in degrees N/S/E/W.
271271
"""
272-
long = long * (180.0 / np.pi)
272+
lon = lon * (180.0 / np.pi)
273273
lat = lat * (180.0 / np.pi)
274274
if lat >= 0.0:
275275
ns = 'N'
276276
else:
277277
ns = 'S'
278-
if long >= 0.0:
278+
if lon >= 0.0:
279279
ew = 'E'
280280
else:
281281
ew = 'W'
282282
# \u00b0 : degree symbol
283-
return '%f\u00b0%s, %f\u00b0%s' % (abs(lat), ns, abs(long), ew)
283+
return '%f\u00b0%s, %f\u00b0%s' % (abs(lat), ns, abs(lon), ew)
284284

285285
class DegreeFormatter(Formatter):
286286
"""

‎lib/matplotlib/projections/geo.py

Copy file name to clipboardExpand all lines: lib/matplotlib/projections/geo.py
+6-6Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -163,19 +163,19 @@ def set_xlim(self, *args, **kwargs):
163163

164164
set_ylim = set_xlim
165165

166-
def format_coord(self, long, lat):
166+
def format_coord(self, lon, lat):
167167
'return a format string formatting the coordinate'
168-
long = long * (180.0 / np.pi)
168+
lon = lon * (180.0 / np.pi)
169169
lat = lat * (180.0 / np.pi)
170170
if lat >= 0.0:
171171
ns = 'N'
172172
else:
173173
ns = 'S'
174-
if long >= 0.0:
174+
if lon >= 0.0:
175175
ew = 'E'
176176
else:
177177
ew = 'W'
178-
return u'%f\u00b0%s, %f\u00b0%s' % (abs(lat), ns, abs(long), ew)
178+
return u'%f\u00b0%s, %f\u00b0%s' % (abs(lat), ns, abs(lon), ew)
179179

180180
def set_longitude_grid(self, degrees):
181181
"""
@@ -576,10 +576,10 @@ def transform_non_affine(self, xy):
576576

577577
lat = np.arcsin(cos_c*np.sin(clat) +
578578
((y*sin_c*np.cos(clat)) / p))
579-
long = clong + np.arctan(
579+
lon = clong + np.arctan(
580580
(x*sin_c) / (p*np.cos(clat)*cos_c - y*np.sin(clat)*sin_c))
581581

582-
return np.concatenate((long, lat), 1)
582+
return np.concatenate((lon, lat), 1)
583583
transform_non_affine.__doc__ = Transform.transform_non_affine.__doc__
584584

585585
def inverted(self):

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.