Skip to content

Commit 7257274

Browse files
author
Jeffrey Whitaker
committed
fix for python 3
1 parent 62c5647 commit 7257274

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

examples/customticks.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from __future__ import unicode_literals
12
from mpl_toolkits.basemap import Basemap
23
import numpy as np
34
import matplotlib.pyplot as plt
@@ -15,7 +16,7 @@ def lat2str(deg):
1516
deg += 1.0
1617
min -= 60.0
1718
dir = 'S'
18-
return (u"%d\N{DEGREE SIGN} %g' %s") % (np.abs(deg),np.abs(min),dir)
19+
return ("%d\N{DEGREE SIGN} %g' %s") % (np.abs(deg),np.abs(min),dir)
1920

2021
def lon2str(deg):
2122
min = 60 * (deg - np.floor(deg))
@@ -26,7 +27,7 @@ def lon2str(deg):
2627
deg += 1.0
2728
min -= 60.0
2829
dir = 'W'
29-
return (u"%d\N{DEGREE SIGN} %g' %s") % (np.abs(deg),np.abs(min),dir)
30+
return ("%d\N{DEGREE SIGN} %g' %s") % (np.abs(deg),np.abs(min),dir)
3031

3132
# (1) use matplotlib custom tick formatter
3233
# instead of Basemap labelling methods.

0 commit comments

Comments
 (0)