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

Skip to content

Commit 82cf8d0

Browse files
authored
Merge branch 'master' into pgf_pdf_pages
2 parents 476ff78 + 6874c42 commit 82cf8d0

95 files changed

Lines changed: 2306 additions & 2278 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
Deprecations
22
````````````
3+
The following modules are deprecated:
4+
5+
- :mod:`matplotlib.compat.subprocess`. This was a python 2 workaround, but all the
6+
functionality can now be found in the python 3 standard library
7+
:mod:`subprocess`.
8+
39
The following functions and classes are deprecated:
410

511
- ``cbook.GetRealpathAndStat`` (which is only a helper for
612
``get_realpath_and_stat``),
713
- ``cbook.is_numlike`` (use ``isinstance(..., numbers.Number)`` instead),
814
- ``mathtext.unichr_safe`` (use ``chr`` instead),
15+
- ``texmanager.dvipng_hack_alpha``,
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
``Axes3D.get_xlim``, ``get_ylim`` and ``get_zlim`` now return a tuple
2+
`````````````````````````````````````````````````````````````````````
3+
4+
They previously returned an array. Returning a tuple is consistent with the
5+
behavior for 2D axes.

doc/devel/MEP/MEP28.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,13 +254,13 @@ This MEP can be divided into a few loosely coupled components:
254254
With this approach, #2 depends and #1, and #4 depends on #3.
255255

256256
There are two possible approaches to #2. The first and most direct would
257-
be to mirror the new ``transform_in`` and ``tranform_out`` parameters of
257+
be to mirror the new ``transform_in`` and ``transform_out`` parameters of
258258
``cbook.boxplot_stats`` in ``Axes.boxplot`` and pass them directly.
259259

260260
The second approach would be to add ``statfxn`` and ``statfxn_args``
261261
parameters to ``Axes.boxplot``. Under this implementation, the default
262262
value of ``statfxn`` would be ``cbook.boxplot_stats``, but users could
263-
pass their own function. Then ``transform_in`` and ``tranform_out`` would
263+
pass their own function. Then ``transform_in`` and ``transform_out`` would
264264
then be passed as elements of the ``statfxn_args`` parameter.
265265

266266
.. code:: python

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 Qt and WX canvases
314-
--------------------------------------
313+
Cairo rendering for Qt, WX, and Tk 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/event_handling/ginput_manual_clabel_sgskip.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ def tellme(s):
4040

4141
plt.waitforbuttonpress()
4242

43-
happy = False
44-
while not happy:
43+
while True:
4544
pts = []
4645
while len(pts) < 3:
4746
tellme('Select 3 corners with mouse')
@@ -54,12 +53,12 @@ def tellme(s):
5453

5554
tellme('Happy? Key click for yes, mouse click for no')
5655

57-
happy = plt.waitforbuttonpress()
56+
if plt.waitforbuttonpress():
57+
break
5858

5959
# Get rid of fill
60-
if not happy:
61-
for p in ph:
62-
p.remove()
60+
for p in ph:
61+
p.remove()
6362

6463

6564
##################################################
@@ -88,13 +87,11 @@ def f(x, y, pts):
8887
tellme('Now do a nested zoom, click to begin')
8988
plt.waitforbuttonpress()
9089

91-
happy = False
92-
while not happy:
90+
while True:
9391
tellme('Select two corners of zoom, middle mouse button to finish')
9492
pts = np.asarray(plt.ginput(2, timeout=-1))
9593

96-
happy = len(pts) < 2
97-
if happy:
94+
if len(pts) < 2:
9895
break
9996

10097
pts = np.sort(pts, axis=0)

examples/tests/backend_driver_sgskip.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ def report_all_missing(directories):
339339
)
340340

341341

342-
from matplotlib.compat import subprocess
342+
import subprocess
343343

344344

345345
def run(arglist):

examples/user_interfaces/embedding_in_wx2_sgskip.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"""
99

1010
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas
11-
from matplotlib.backends.backend_wx import NavigationToolbar2Wx
11+
from matplotlib.backends.backend_wx import NavigationToolbar2Wx as NavigationToolbar
1212
from matplotlib.figure import Figure
1313

1414
import numpy as np
@@ -38,7 +38,7 @@ def __init__(self):
3838
self.add_toolbar() # comment this out for no toolbar
3939

4040
def add_toolbar(self):
41-
self.toolbar = NavigationToolbar2Wx(self.canvas)
41+
self.toolbar = NavigationToolbar(self.canvas)
4242
self.toolbar.Realize()
4343
# By adding toolbar in sizer, we are able to put it at the bottom
4444
# of the frame - so appearance is closer to GTK version.

examples/user_interfaces/embedding_in_wx3_sgskip.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
import matplotlib
3030
import matplotlib.cm as cm
3131
import matplotlib.cbook as cbook
32-
from matplotlib.backends.backend_wxagg import Toolbar, FigureCanvasWxAgg
32+
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas
33+
from matplotlib.backends.backend_wxagg import NavigationToolbar2WxAgg as NavigationToolbar
3334
from matplotlib.figure import Figure
3435
import numpy as np
3536

@@ -47,8 +48,8 @@ def __init__(self, parent):
4748
wx.Panel.__init__(self, parent, -1)
4849

4950
self.fig = Figure((5, 4), 75)
50-
self.canvas = FigureCanvasWxAgg(self, -1, self.fig)
51-
self.toolbar = Toolbar(self.canvas) # matplotlib toolbar
51+
self.canvas = FigureCanvas(self, -1, self.fig)
52+
self.toolbar = NavigationToolbar(self.canvas) # matplotlib toolbar
5253
self.toolbar.Realize()
5354
# self.toolbar.set_active([0,1])
5455

examples/user_interfaces/embedding_in_wx4_sgskip.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"""
88

99
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas
10-
from matplotlib.backends.backend_wxagg import NavigationToolbar2WxAgg
10+
from matplotlib.backends.backend_wxagg import NavigationToolbar2WxAgg as NavigationToolbar
1111
from matplotlib.backends.backend_wx import _load_bitmap
1212
from matplotlib.figure import Figure
1313

@@ -16,14 +16,14 @@
1616
import wx
1717

1818

19-
class MyNavigationToolbar(NavigationToolbar2WxAgg):
19+
class MyNavigationToolbar(NavigationToolbar):
2020
"""
2121
Extend the default wx toolbar with your own event handlers
2222
"""
2323
ON_CUSTOM = wx.NewId()
2424

2525
def __init__(self, canvas, cankill):
26-
NavigationToolbar2WxAgg.__init__(self, canvas)
26+
NavigationToolbar.__init__(self, canvas)
2727

2828
# for simplicity I'm going to reuse a bitmap from wx, you'll
2929
# probably want to add your own.

examples/user_interfaces/embedding_in_wx5_sgskip.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,16 @@
1414
import wx.aui as aui
1515

1616
import matplotlib as mpl
17-
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as Canvas
18-
from matplotlib.backends.backend_wxagg import NavigationToolbar2Wx as Toolbar
17+
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas
18+
from matplotlib.backends.backend_wxagg import NavigationToolbar2WxAgg as NavigationToolbar
1919

2020

2121
class Plot(wx.Panel):
2222
def __init__(self, parent, id=-1, dpi=None, **kwargs):
2323
wx.Panel.__init__(self, parent, id=id, **kwargs)
2424
self.figure = mpl.figure.Figure(dpi=dpi, figsize=(2, 2))
25-
self.canvas = Canvas(self, -1, self.figure)
26-
self.toolbar = Toolbar(self.canvas)
25+
self.canvas = FigureCanvas(self, -1, self.figure)
26+
self.toolbar = NavigationToolbar(self.canvas)
2727
self.toolbar.Realize()
2828

2929
sizer = wx.BoxSizer(wx.VERTICAL)

0 commit comments

Comments
 (0)