Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commit9d369a1

Browse files
Merge branch 'master' into wx-inconsistencies
2 parentsdeeeeb6 +254cdac commit9d369a1

File tree

133 files changed

+1670
-2110
lines changed

Some content is hidden

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

133 files changed

+1670
-2110
lines changed

‎README.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ platforms. Matplotlib can be used in Python scripts, the Python and IPython
3333
shell (à la MATLAB or Mathematica), web application servers, and various
3434
graphical user interface toolkits.
3535

36+
NOTE: The current master branch is now Python 3 only. Python 2 support is
37+
being dropped.
38+
3639
`Home page<http://matplotlib.org/>`_
3740

3841
Installation
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
Deprecations
22
````````````
3-
``cbook.is_numlike`` is deprecated. Use ``isinstance(..., numbers.Number)``
4-
instead.
3+
The following functions and classes are deprecated:
4+
5+
- ``cbook.GetRealpathAndStat`` (which is only a helper for
6+
``get_realpath_and_stat``),
7+
- ``cbook.is_numlike`` (use ``isinstance(..., numbers.Number)`` instead),
8+
- ``mathtext.unichr_safe`` (use ``chr`` instead),
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
matplotlib.cbook.Bunch deprecated
2+
`````````````````````````````````
3+
The ``matplotlib.cbook.Bunch`` class has been deprecated. Instead, use
4+
`types.SimpleNamespace` from the standard library which provides the same
5+
functionality.

‎doc/users/whats_new.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -310,11 +310,12 @@ Thus, to force usage of PGI when both bindings are installed, import it first.
310310

311311

312312

313-
Cairo rendering for QtandWX canvases
314-
--------------------------------------
313+
Cairo rendering for Qt, WX,andTk canvases
314+
-------------------------------------------
315315

316-
The new ``Qt4Cairo``, ``Qt5Cairo``, and ``WXCairo`` backends allow Qt and Wx
317-
canvases to use Cairo rendering instead of Agg.
316+
The new ``Qt4Cairo``, ``Qt5Cairo``, ``WXCairo``, and ``TkCairo``
317+
backends allow Qt, Wx, and Tk canvases to use Cairo rendering instead of
318+
Agg.
318319

319320

320321
Added support for QT in new ToolManager

‎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__importprint_function
1110
importnumpyasnp
1211
importmatplotlib.pyplotasplt
1312
importmatplotlib.cbookascbook

‎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__importunicode_literals
12-
139
importmatplotlib
1410
frommatplotlib.axesimportAxes
1511
frommatplotlib.patchesimportCircle

‎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 aMercator 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__importunicode_literals
12-
1310
importnumpyasnp
1411
fromnumpyimportma
1512
frommatplotlibimportscaleasmscale

‎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
importmatplotlib.pyplotasplt
1515
importmatplotlib.tickerasmticker
1616
fromcyclerimportcycler
17-
fromsix.movesimportzip
1817

1918

2019
deffilled_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
iflabel_data:
153-
loop_iter=enumerate((stacked_data[lab],lab,s)forlab,sin
154-
zip(labels,sty_cycle))
152+
loop_iter=enumerate((stacked_data[lab],lab,s)
153+
forlab,sinzip(labels,sty_cycle))
155154
else:
156155
loop_iter=enumerate(zip(stacked_data,labels,sty_cycle))
157156

‎examples/api/radar_chart.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,18 +60,18 @@ class RadarAxes(PolarAxes):
6060
draw_patch=patch_dict[frame]
6161

6262
def__init__(self,*args,**kwargs):
63-
super(RadarAxes,self).__init__(*args,**kwargs)
63+
super().__init__(*args,**kwargs)
6464
# rotate plot such that the first axis is at the top
6565
self.set_theta_zero_location('N')
6666

6767
deffill(self,*args,**kwargs):
6868
"""Override fill so that line is closed by default"""
6969
closed=kwargs.pop('closed',True)
70-
returnsuper(RadarAxes,self).fill(closed=closed,*args,**kwargs)
70+
returnsuper().fill(closed=closed,*args,**kwargs)
7171

7272
defplot(self,*args,**kwargs):
7373
"""Override plot so that line is closed by default"""
74-
lines=super(RadarAxes,self).plot(*args,**kwargs)
74+
lines=super().plot(*args,**kwargs)
7575
forlineinlines:
7676
self._close_line(line)
7777

‎examples/api/skewt.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def update_position(self, loc):
2828
# This ensures that the new value of the location is set before
2929
# any other updates take place
3030
self._loc=loc
31-
super(SkewXTick,self).update_position(loc)
31+
super().update_position(loc)
3232

3333
def_has_default_loc(self):
3434
returnself.get_loc()isNone
@@ -180,10 +180,10 @@ def upper_xlim(self):
180180

181181
if__name__=='__main__':
182182
# Now make a simple example using the custom projection.
183+
fromioimportStringIO
183184
frommatplotlib.tickerimport (MultipleLocator,NullFormatter,
184185
ScalarFormatter)
185186
importmatplotlib.pyplotasplt
186-
fromsiximportStringIO
187187
importnumpyasnp
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__importprint_function
98
importnumpyasnp
109
importmatplotlib.cbookascbook
1110
importmatplotlib.imageasimage

‎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__importdivision
98

109
importmatplotlib.pyplotasplt
1110
frommatplotlibimportcolorsasmcolors

‎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__importprint_function
98
importmatplotlib.pyplotasplt
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__importprint_function
109
importsys
1110
importmatplotlib.pyplotasplt
1211
importnumpyasnp

‎examples/event_handling/figure_axes_enter_leave.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
Illustrate the figure and axes enter and leave events by changing the
77
frame colors on enter and leave
88
"""
9-
from __future__importprint_function
109
importmatplotlib.pyplotasplt
1110

1211

‎examples/event_handling/ginput_demo_sgskip.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
88
"""
99

10-
from __future__importprint_function
1110

1211
importmatplotlib.pyplotasplt
1312
importnumpyasnp

‎examples/event_handling/ginput_manual_clabel_sgskip.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
1515
"""
1616

17-
from __future__importprint_function
1817

1918
importtime
2019
importmatplotlib

‎examples/event_handling/image_slices_viewer.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
66
Scroll through 2D image slices of a 3D array.
77
"""
8-
from __future__importprint_function
98

109
importnumpyasnp
1110
importmatplotlib.pyplotasplt

‎examples/event_handling/keypress_demo.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
66
Show how to connect to keypress events
77
"""
8-
from __future__importprint_function
98
importsys
109
importnumpyasnp
1110
importmatplotlib.pyplotasplt

‎examples/event_handling/pick_event_demo.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ def pick_handler(event):
6666
The examples below illustrate each of these methods.
6767
"""
6868

69-
from __future__importprint_function
7069
importmatplotlib.pyplotasplt
7170
frommatplotlib.linesimportLine2D
7271
frommatplotlib.patchesimportRectangle

‎examples/event_handling/pipong.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
pipong.py was written by Paul Ivanov <http://pirsquared.org>
99
"""
1010

11-
from __future__importprint_function
1211

1312
importnumpyasnp
1413
importmatplotlib.pyplotasplt

‎examples/event_handling/pong_sgskip.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
This example requires :download:`pipong.py <pipong.py>`
1111
1212
"""
13-
from __future__importprint_function,division
1413
importtime
1514

1615

‎examples/images_contours_and_fields/image_demo.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
functionality of imshow and the many images you can create.
1111
1212
"""
13-
from __future__importprint_function
1413

1514
importnumpyasnp
1615
importmatplotlib.cmascm

‎examples/images_contours_and_fields/layer_images.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
66
Layer images above one another using alpha blending
77
"""
8-
from __future__importdivision
98
importmatplotlib.pyplotasplt
109
importnumpyasnp
1110

‎examples/lines_bars_and_markers/marker_reference.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
66
Reference for filled- and unfilled-marker types included with Matplotlib.
77
"""
8-
fromsiximportiteritems
8+
99
importnumpyasnp
1010
importmatplotlib.pyplotasplt
1111
frommatplotlib.linesimportLine2D
@@ -36,9 +36,7 @@ def split_list(a_list):
3636
fig,axes=plt.subplots(ncols=2)
3737

3838
# Filter out filled markers and marker settings that do nothing.
39-
# We use iteritems from six to make sure that we get an iterator
40-
# in both python 2 and 3
41-
unfilled_markers= [mform,funciniteritems(Line2D.markers)
39+
unfilled_markers= [mform,funcinLine2D.markers.items()
4240
iffunc!='nothing'andmnotinLine2D.filled_markers]
4341
# Reverse-sort for pretty. We use our own sort key which is essentially
4442
# a python3 compatible reimplementation of python2 sort.

‎examples/lines_bars_and_markers/markevery_demo.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
2121
"""
2222

23-
from __future__importdivision
2423
importnumpyasnp
2524
importmatplotlib.pyplotasplt
2625
importmatplotlib.gridspecasgridspec

‎examples/misc/anchored_artists.py

Lines changed: 12 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,18 @@
44
================
55
66
"""
7-
frommatplotlib.patchesimportRectangle,Ellipse
87

9-
frommatplotlib.offsetboximportAnchoredOffsetbox,AuxTransformBox,VPacker,\
10-
TextArea,DrawingArea
8+
frommatplotlib.patchesimportRectangle,Ellipse
9+
frommatplotlib.offsetboximport (
10+
AnchoredOffsetbox,AuxTransformBox,DrawingArea,TextArea,VPacker)
1111

1212

1313
classAnchoredText(AnchoredOffsetbox):
1414
def__init__(self,s,loc,pad=0.4,borderpad=0.5,
1515
prop=None,frameon=True):
16-
17-
self.txt=TextArea(s,
18-
minimumdescent=False)
19-
20-
super(AnchoredText,self).__init__(loc,pad=pad,borderpad=borderpad,
21-
child=self.txt,
22-
prop=prop,
23-
frameon=frameon)
16+
self.txt=TextArea(s,minimumdescent=False)
17+
super().__init__(loc,pad=pad,borderpad=borderpad,
18+
child=self.txt,prop=prop,frameon=frameon)
2419

2520

2621
classAnchoredSizeBar(AnchoredOffsetbox):
@@ -42,10 +37,8 @@ def __init__(self, transform, size, label, loc,
4237
align="center",
4338
pad=0,sep=sep)
4439

45-
AnchoredOffsetbox.__init__(self,loc,pad=pad,borderpad=borderpad,
46-
child=self._box,
47-
prop=prop,
48-
frameon=frameon)
40+
super().__init__(loc,pad=pad,borderpad=borderpad,
41+
child=self._box,prop=prop,frameon=frameon)
4942

5043

5144
classAnchoredEllipse(AnchoredOffsetbox):
@@ -59,24 +52,16 @@ def __init__(self, transform, width, height, angle, loc,
5952
self._box=AuxTransformBox(transform)
6053
self.ellipse=Ellipse((0,0),width,height,angle)
6154
self._box.add_artist(self.ellipse)
62-
63-
AnchoredOffsetbox.__init__(self,loc,pad=pad,borderpad=borderpad,
64-
child=self._box,
65-
prop=prop,
66-
frameon=frameon)
55+
super().__init__(loc,pad=pad,borderpad=borderpad,
56+
child=self._box,prop=prop,frameon=frameon)
6757

6858

6959
classAnchoredDrawingArea(AnchoredOffsetbox):
7060
def__init__(self,width,height,xdescent,ydescent,
7161
loc,pad=0.4,borderpad=0.5,prop=None,frameon=True):
72-
7362
self.da=DrawingArea(width,height,xdescent,ydescent)
74-
75-
super(AnchoredDrawingArea,self).__init__(loc,pad=pad,
76-
borderpad=borderpad,
77-
child=self.da,
78-
prop=None,
79-
frameon=frameon)
63+
super().__init__(loc,pad=pad,borderpad=borderpad,
64+
child=self.da,prop=None,frameon=frameon)
8065

8166

8267
if__name__=="__main__":

‎examples/misc/cursor_demo_sgskip.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
https://github.com/joferkington/mpldatacursor
1717
https://github.com/anntzer/mplcursors
1818
"""
19-
from __future__importprint_function
2019
importmatplotlib.pyplotasplt
2120
importnumpyasnp
2221

‎examples/misc/font_indexing.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
tables relate to one another. Mainly for mpl developers....
88
99
"""
10-
from __future__importprint_function
1110
importmatplotlib
1211
frommatplotlib.ft2fontimportFT2Font,KERNING_DEFAULT,KERNING_UNFITTED,KERNING_UNSCALED
1312

‎examples/misc/ftface_props.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
individual character metrics, use the Glyph object, as returned by
99
load_char
1010
"""
11-
from __future__importprint_function
1211
importmatplotlib
1312
importmatplotlib.ft2fontasft
1413

‎examples/misc/image_thumbnail_sgskip.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
1111
"""
1212

13-
from __future__importprint_function
1413
# build thumbnails of all images in a directory
1514
importsys
1615
importos

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp