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

Skip to content

Commit f3e03d2

Browse files
authored
Merge pull request #11476 from timhoffm/remove-pylab-references
Remove pylab references
2 parents 0baeca9 + c76a337 commit f3e03d2

File tree

10 files changed

+28
-34
lines changed

10 files changed

+28
-34
lines changed

examples/user_interfaces/pylab_with_gtk_sgskip.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
"""
2-
==============
3-
Pylab With GTK
4-
==============
2+
===============
3+
Pyplot With GTK
4+
===============
55
6-
An example of how to use pylab to manage your figure windows, but
6+
An example of how to use pyplot to manage your figure windows, but
77
modify the GUI by accessing the underlying gtk widgets
88
"""
99
import matplotlib

lib/matplotlib/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
Modules include:
2929
3030
:mod:`matplotlib.axes`
31-
defines the :class:`~matplotlib.axes.Axes` class. Most pylab
31+
defines the :class:`~matplotlib.axes.Axes` class. Most pyplot
3232
commands are wrappers for :class:`~matplotlib.axes.Axes`
3333
methods. The axes module is the highest level of OO access to
3434
the library.
@@ -90,7 +90,7 @@
9090
a function for setting the matplotlib backend. If used, this
9191
function must be called immediately after importing matplotlib
9292
for the first time. In particular, it must be called
93-
**before** importing pylab (if pylab is imported).
93+
**before** importing pyplot (if pyplot is imported).
9494
9595
matplotlib was initially written by John D. Hunter (1968-2012) and is now
9696
developed and maintained by a host of others.

lib/matplotlib/backends/backend_template.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
2222
import matplotlib
2323
matplotlib.use('xxx')
24-
from pylab import *
25-
plot([1,2,3])
24+
import matplotlib.pyplot as plt
25+
plt.plot([1,2,3])
2626
show()
2727
2828
matplotlib also supports external backends, so you can place you can
@@ -175,7 +175,7 @@ def draw_if_interactive():
175175
def show(block=None):
176176
"""
177177
For image backends - is not required
178-
For GUI backends - show() is usually the last line of a pylab script and
178+
For GUI backends - show() is usually the last line of a pyplot script and
179179
tells the backend that it is time to draw. In interactive mode, this may
180180
be a do nothing func. See the GTK backend for an example of how to handle
181181
interactive versus batch mode

lib/matplotlib/figure.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1892,7 +1892,7 @@ def colorbar(self, mappable, cax=None, ax=None, use_gridspec=True, **kw):
18921892
"""
18931893
Create a colorbar for a ScalarMappable instance, *mappable*.
18941894
1895-
Documentation for the pylab thin wrapper:
1895+
Documentation for the pyplot thin wrapper:
18961896
%(colorbar_doc)s
18971897
"""
18981898
if ax is None:

lib/matplotlib/mlab.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -841,15 +841,15 @@ def _single_spectrum_helper(x, mode, Fs=None, window=None, pad_to=None,
841841
The function applied to each segment before fft-ing,
842842
designed to remove the mean or linear trend. Unlike in
843843
MATLAB, where the *detrend* parameter is a vector, in
844-
matplotlib is it a function. The :mod:`~matplotlib.pylab`
845-
module defines :func:`~matplotlib.pylab.detrend_none`,
846-
:func:`~matplotlib.pylab.detrend_mean`, and
847-
:func:`~matplotlib.pylab.detrend_linear`, but you can use
844+
matplotlib is it a function. The :mod:`~matplotlib.mlab`
845+
module defines :func:`~matplotlib.mlab.detrend_none`,
846+
:func:`~matplotlib.mlab.detrend_mean`, and
847+
:func:`~matplotlib.mlab.detrend_linear`, but you can use
848848
a custom function as well. You can also use a string to choose
849849
one of the functions. 'default', 'constant', and 'mean' call
850-
:func:`~matplotlib.pylab.detrend_mean`. 'linear' calls
851-
:func:`~matplotlib.pylab.detrend_linear`. 'none' calls
852-
:func:`~matplotlib.pylab.detrend_none`.
850+
:func:`~matplotlib.mlab.detrend_mean`. 'linear' calls
851+
:func:`~matplotlib.mlab.detrend_linear`. 'none' calls
852+
:func:`~matplotlib.mlab.detrend_none`.
853853
854854
scale_by_freq : bool, optional
855855
Specifies whether the resulting density values should be scaled

lib/matplotlib/pyplot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2117,7 +2117,7 @@ def plotfile(fname, cols=(0,), plotfuncs=None,
21172117
columns.
21182118
21192119
*comments*, *skiprows*, *checkrows*, *delimiter*, and *names*
2120-
are all passed on to :func:`matplotlib.pylab.csv2rec` to
2120+
are all passed on to :func:`matplotlib.mlab.csv2rec` to
21212121
load the data into a record array.
21222122
21232123
If *newfig* is *True*, the plot always will be made in a new figure;

lib/matplotlib/quiver.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ def __init__(self, ax, *args,
439439
"""
440440
The constructor takes one required argument, an Axes
441441
instance, followed by the args and kwargs described
442-
by the following pylab interface documentation:
442+
by the following pyplot interface documentation:
443443
%s
444444
"""
445445
self.ax = ax
@@ -912,7 +912,7 @@ def __init__(self, ax, *args,
912912
"""
913913
The constructor takes one required argument, an Axes
914914
instance, followed by the args and kwargs described
915-
by the following pylab interface documentation:
915+
by the following pyplot interface documentation:
916916
%(barbs_doc)s
917917
"""
918918
self.sizes = sizes or dict()

lib/matplotlib/widgets.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1332,18 +1332,13 @@ class MultiCursor(Widget):
13321332
Example usage::
13331333
13341334
from matplotlib.widgets import MultiCursor
1335-
from pylab import figure, show, np
1335+
import matplotlib.pyplot as plt
1336+
import numpy as np
13361337
1338+
fig, (ax1, ax2) = plt.subplots(nrows=2, sharex=True)
13371339
t = np.arange(0.0, 2.0, 0.01)
1338-
s1 = np.sin(2*np.pi*t)
1339-
s2 = np.sin(4*np.pi*t)
1340-
fig = figure()
1341-
ax1 = fig.add_subplot(211)
1342-
ax1.plot(t, s1)
1343-
1344-
1345-
ax2 = fig.add_subplot(212, sharex=ax1)
1346-
ax2.plot(t, s2)
1340+
ax1.plot(t, np.sin(2*np.pi*t))
1341+
ax2.plot(t, np.sin(4*np.pi*t))
13471342
13481343
multi = MultiCursor(fig.canvas, (ax1, ax2), color='r', lw=1,
13491344
horizOn=False, vertOn=True)

lib/mpl_toolkits/axes_grid1/colorbar.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ class ColorbarBase(cm.ScalarMappable):
295295
Draw a colorbar in an existing axes.
296296
297297
This is a base class for the :class:`Colorbar` class, which is the
298-
basis for the :func:`~matplotlib.pyplot.colorbar` method and pylab
298+
basis for the :func:`~matplotlib.pyplot.colorbar` method and pyplot
299299
function.
300300
301301
It is also useful by itself for showing a colormap. If the *cmap*
@@ -799,7 +799,7 @@ def colorbar(mappable, cax=None, ax=None, **kw):
799799
"""
800800
Create a colorbar for a ScalarMappable instance.
801801
802-
Documentation for the pylab thin wrapper:
802+
Documentation for the pyplot thin wrapper:
803803
804804
%s
805805
"""

setup.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,8 +255,7 @@ def run(self):
255255
Matplotlib strives to produce publication quality 2D graphics
256256
for interactive graphing, scientific publishing, user interface
257257
development and web application servers targeting multiple user
258-
interfaces and hardcopy output formats. There is a 'pylab' mode
259-
which emulates MATLAB graphics.
258+
interfaces and hardcopy output formats.
260259
""",
261260
license="BSD",
262261
packages=packages,

0 commit comments

Comments
 (0)