Skip to content

Commit 8f605e1

Browse files
author
Dvij
committed
Revert "fix matplotlib#3483"
This reverts commit fdb66ae.
1 parent fdb66ae commit 8f605e1

1 file changed

Lines changed: 8 additions & 48 deletions

File tree

‎lib/matplotlib/pyplot.py‎

Lines changed: 8 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@
5252

5353
# We may not need the following imports here:
5454
from matplotlib.colors import Normalize
55-
from matplotlib.colors import normalize # for backwards compat.
5655
from matplotlib.lines import Line2D
5756
from matplotlib.text import Text, Annotation
5857
from matplotlib.patches import Polygon, Rectangle, Circle, Arrow
@@ -171,46 +170,6 @@ def ion():
171170
'Turn interactive mode on.'
172171
matplotlib.interactive(True)
173172

174-
def pickle_save(obj, f=None, protocol=0):
175-
"""
176-
Write a pickled representation of obj as a string or a file depending on the number and type of arguments used.
177-
178-
``pickle_save(obj, file, protocol)`` Write a pickled representation of obj to the open file object file.
179-
180-
``pickle_save(obj, protocol)`` Return the pickled representation of the object as a string, instead of writing it to a file.
181-
"""
182-
import pickle
183-
184-
if not f:
185-
return pickle.dumps(obj, protocol)
186-
187-
pickle.dump(obj, f, protocol)
188-
189-
def pickle_load(*args, **kwargs):
190-
"""
191-
Read a string or pickled object and reconstruct the original object hierarchy.
192-
193-
``pickle_load(file)`` Read a string from the open file object file and interpret it as a pickle data stream, reconstructing and returning the original object hierarchy.
194-
195-
``pick_load(str)`` Read a pickled object hierarchy from a string. Characters in the string past the pickled object’s representation are ignored.
196-
197-
"""
198-
import pickle
199-
200-
state = isinteractive()
201-
if state:
202-
ioff()
203-
if len(args) != 1 or not(isinstance(args[0], str) or isinstance(args[0], file)):
204-
warnings.warn('Unsupported number/type of argument(s).')
205-
if isinstance(args[0], str):
206-
unpickledobj = pickle.loads(args[0])
207-
if state:
208-
ion()
209-
return unpickledobj
210-
211-
pickle.load(args[0])
212-
if state:
213-
ion()
214173

215174
def pause(interval):
216175
"""
@@ -493,7 +452,7 @@ def make_active(event):
493452

494453

495454
def gcf():
496-
"Return a reference to the current figure."
455+
"Get a reference to the current figure."
497456

498457
figManager = _pylab_helpers.Gcf.get_active()
499458
if figManager is not None:
@@ -849,12 +808,12 @@ def sca(ax):
849808

850809
def gca(**kwargs):
851810
"""
852-
Return the current :class:`~matplotlib.axes.Axes` instance on the
811+
Get the current :class:`~matplotlib.axes.Axes` instance on the
853812
current figure matching the given keyword args, or create one.
854813
855814
Examples
856815
---------
857-
To get the the current polar axes on the current figure::
816+
To get the current polar axes on the current figure::
858817
859818
plt.gca(projection='polar')
860819
@@ -1201,7 +1160,7 @@ def subplot2grid(shape, loc, rowspan=1, colspan=1, **kwargs):
12011160
12021161
is identical to ::
12031162
1204-
gridspec=GridSpec(shape[0], shape[2])
1163+
gridspec=GridSpec(shape[0], shape[1])
12051164
subplotspec=gridspec.new_subplotspec(loc, rowspan, colspan)
12061165
subplot(subplotspec)
12071166
"""
@@ -2222,7 +2181,7 @@ def clim(vmin=None, vmax=None):
22222181
"""
22232182
im = gci()
22242183
if im is None:
2225-
raise RuntimeError('You must first define an image, eg with imshow')
2184+
raise RuntimeError('You must first define an image, e.g., with imshow')
22262185

22272186
im.set_clim(vmin, vmax)
22282187
draw_if_interactive()
@@ -3106,7 +3065,7 @@ def phase_spectrum(x, Fs=None, Fc=None, window=None, pad_to=None, sides=None,
31063065
def pie(x, explode=None, labels=None, colors=None, autopct=None,
31073066
pctdistance=0.6, shadow=False, labeldistance=1.1, startangle=None,
31083067
radius=None, counterclock=True, wedgeprops=None, textprops=None,
3109-
hold=None):
3068+
center=(0, 0), frame=False, hold=None):
31103069
ax = gca()
31113070
# allow callers to override the hold state by passing hold=True|False
31123071
washold = ax.ishold()
@@ -3118,7 +3077,8 @@ def pie(x, explode=None, labels=None, colors=None, autopct=None,
31183077
autopct=autopct, pctdistance=pctdistance, shadow=shadow,
31193078
labeldistance=labeldistance, startangle=startangle,
31203079
radius=radius, counterclock=counterclock,
3121-
wedgeprops=wedgeprops, textprops=textprops)
3080+
wedgeprops=wedgeprops, textprops=textprops, center=center,
3081+
frame=frame)
31223082
draw_if_interactive()
31233083
finally:
31243084
ax.hold(washold)

0 commit comments

Comments
 (0)