From 5fb0a5792320de7e5aeead290abeb2f48f4bcd46 Mon Sep 17 00:00:00 2001 From: Joe Kington Date: Mon, 3 Dec 2012 21:09:41 -0600 Subject: [PATCH] Renamed all instances of variables named "long" to "lon" to avoid clobbering by 2to3 --- examples/api/custom_projection_example.py | 8 ++++---- lib/matplotlib/projections/geo.py | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/examples/api/custom_projection_example.py b/examples/api/custom_projection_example.py index eb5493836310..2ee0cbb85964 100644 --- a/examples/api/custom_projection_example.py +++ b/examples/api/custom_projection_example.py @@ -262,25 +262,25 @@ def set_xlim(self, *args, **kwargs): Axes.set_ylim(self, -np.pi / 2.0, np.pi / 2.0) set_ylim = set_xlim - def format_coord(self, long, lat): + def format_coord(self, lon, lat): """ Override this method to change how the values are displayed in the status bar. In this case, we want them to be displayed in degrees N/S/E/W. """ - long = long * (180.0 / np.pi) + lon = lon * (180.0 / np.pi) lat = lat * (180.0 / np.pi) if lat >= 0.0: ns = 'N' else: ns = 'S' - if long >= 0.0: + if lon >= 0.0: ew = 'E' else: ew = 'W' # \u00b0 : degree symbol - return '%f\u00b0%s, %f\u00b0%s' % (abs(lat), ns, abs(long), ew) + return '%f\u00b0%s, %f\u00b0%s' % (abs(lat), ns, abs(lon), ew) class DegreeFormatter(Formatter): """ diff --git a/lib/matplotlib/projections/geo.py b/lib/matplotlib/projections/geo.py index 692e6c60d10e..88e996a17b3b 100644 --- a/lib/matplotlib/projections/geo.py +++ b/lib/matplotlib/projections/geo.py @@ -163,19 +163,19 @@ def set_xlim(self, *args, **kwargs): set_ylim = set_xlim - def format_coord(self, long, lat): + def format_coord(self, lon, lat): 'return a format string formatting the coordinate' - long = long * (180.0 / np.pi) + lon = lon * (180.0 / np.pi) lat = lat * (180.0 / np.pi) if lat >= 0.0: ns = 'N' else: ns = 'S' - if long >= 0.0: + if lon >= 0.0: ew = 'E' else: ew = 'W' - return u'%f\u00b0%s, %f\u00b0%s' % (abs(lat), ns, abs(long), ew) + return u'%f\u00b0%s, %f\u00b0%s' % (abs(lat), ns, abs(lon), ew) def set_longitude_grid(self, degrees): """ @@ -576,10 +576,10 @@ def transform_non_affine(self, xy): lat = np.arcsin(cos_c*np.sin(clat) + ((y*sin_c*np.cos(clat)) / p)) - long = clong + np.arctan( + lon = clong + np.arctan( (x*sin_c) / (p*np.cos(clat)*cos_c - y*np.sin(clat)*sin_c)) - return np.concatenate((long, lat), 1) + return np.concatenate((lon, lat), 1) transform_non_affine.__doc__ = Transform.transform_non_affine.__doc__ def inverted(self):