Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a51b708

Browse files
committed
py3fy examples
- Remove future imports, six, encoding cookies. - The pgf_examples don't actually need to be sgskipped.
1 parent 637b649 commit a51b708

59 files changed

Lines changed: 43 additions & 133 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

examples/api/custom_index_formatter.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
to leave out days on which there is no data, i.e. weekends. The example
88
below shows how to use an 'index formatter' to achieve the desired plot
99
"""
10-
from __future__ import print_function
1110
import numpy as np
1211
import matplotlib.pyplot as plt
1312
import matplotlib.cbook as cbook

examples/api/custom_projection_example.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,9 @@
33
Custom projection
44
=================
55
6-
Showcase Hammer projection by alleviating many features of
7-
matplotlib.
6+
Showcase Hammer projection by alleviating many features of Matplotlib.
87
"""
98

10-
11-
from __future__ import unicode_literals
12-
139
import matplotlib
1410
from matplotlib.axes import Axes
1511
from matplotlib.patches import Circle

examples/api/custom_scale_example.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,10 @@
33
Custom scale
44
============
55
6-
Create a custom scale, by implementing the
7-
scaling use for latitude data in a Mercator Projection.
6+
Create a custom scale, by implementing the scaling use for latitude data in a
7+
Mercator Projection.
88
"""
99

10-
11-
from __future__ import unicode_literals
12-
1310
import numpy as np
1411
from numpy import ma
1512
from matplotlib import scale as mscale

examples/api/engineering_formatter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
# `sep` (separator between the number and the prefix/unit).
3636
ax1.set_title('SI-prefix only ticklabels, 1-digit precision & '
3737
'thin space separator')
38-
formatter1 = EngFormatter(places=1, sep=u"\N{THIN SPACE}") # U+2009
38+
formatter1 = EngFormatter(places=1, sep="\N{THIN SPACE}") # U+2009
3939
ax1.xaxis.set_major_formatter(formatter1)
4040
ax1.plot(xs, ys)
4141
ax1.set_xlabel('Frequency [Hz]')

examples/api/filled_step.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
import matplotlib.pyplot as plt
1515
import matplotlib.ticker as mticker
1616
from cycler import cycler
17-
from six.moves import zip
1817

1918

2019
def filled_hist(ax, edges, values, bottoms=None, orientation='v',
@@ -150,8 +149,8 @@ def stack_hist(ax, stacked_data, sty_cycle, bottoms=None,
150149
labels = itertools.repeat(None)
151150

152151
if label_data:
153-
loop_iter = enumerate((stacked_data[lab], lab, s) for lab, s in
154-
zip(labels, sty_cycle))
152+
loop_iter = enumerate((stacked_data[lab], lab, s)
153+
for lab, s in zip(labels, sty_cycle))
155154
else:
156155
loop_iter = enumerate(zip(stacked_data, labels, sty_cycle))
157156

examples/api/skewt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,10 +180,10 @@ def upper_xlim(self):
180180

181181
if __name__ == '__main__':
182182
# Now make a simple example using the custom projection.
183+
from io import StringIO
183184
from matplotlib.ticker import (MultipleLocator, NullFormatter,
184185
ScalarFormatter)
185186
import matplotlib.pyplot as plt
186-
from six import StringIO
187187
import numpy as np
188188

189189
# Some examples data

examples/api/watermark_image.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
66
Use a PNG file as a watermark
77
"""
8-
from __future__ import print_function
98
import numpy as np
109
import matplotlib.cbook as cbook
1110
import matplotlib.image as image

examples/color/named_colors.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
66
Simple plot example with the named colors and its visual representation.
77
"""
8-
from __future__ import division
98

109
import matplotlib.pyplot as plt
1110
from matplotlib import colors as mcolors

examples/event_handling/close_event.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
66
Example to show connecting events that occur when the figure closes.
77
"""
8-
from __future__ import print_function
98
import matplotlib.pyplot as plt
109

1110

examples/event_handling/coords_demo.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
An example of how to interact with the plotting canvas by connecting
77
to move and click events
88
"""
9-
from __future__ import print_function
109
import sys
1110
import matplotlib.pyplot as plt
1211
import numpy as np

0 commit comments

Comments
 (0)