From f81082ab5f403eed216d05ad17b41214a7012611 Mon Sep 17 00:00:00 2001 From: David Stansby Date: Thu, 15 Feb 2018 23:34:02 +0000 Subject: [PATCH 1/4] Remove the 'hold' kwarg from codebase Fix data kwarg Fix contour boilerplating Remove last bits of _hold --- lib/matplotlib/axes/_axes.py | 124 +--- lib/matplotlib/axes/_base.py | 52 -- lib/matplotlib/colorbar.py | 16 +- lib/matplotlib/figure.py | 28 - lib/matplotlib/pyplot.py | 898 +++-------------------- lib/matplotlib/rcsetup.py | 10 - lib/matplotlib/tri/tricontour.py | 6 +- lib/mpl_toolkits/axes_grid1/axes_grid.py | 2 - lib/mpl_toolkits/axes_grid1/colorbar.py | 1 - tools/boilerplate.py | 28 +- 10 files changed, 97 insertions(+), 1068 deletions(-) diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index d476deb356fd..375b5b9a63b5 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -1343,9 +1343,6 @@ def plot(self, *args, **kwargs): """ scalex = kwargs.pop('scalex', True) scaley = kwargs.pop('scaley', True) - - if not self._hold: - self.cla() lines = [] kwargs = cbook.normalize_kwargs(kwargs, mlines.Line2D._alias_map) @@ -1423,10 +1420,6 @@ def plot_date(self, x, y, fmt='o', tz=None, xdate=True, ydate=False, `.AutoDateFormatter` (if the tick formatter is not already set to a `.DateFormatter` instance). """ - - if not self._hold: - self.cla() - if xdate: self.xaxis_date(tz) if ydate: @@ -1482,9 +1475,6 @@ def loglog(self, *args, **kwargs): **kwargs All parameters supported by `.plot`. """ - if not self._hold: - self.cla() - dx = {k: kwargs.pop(k) for k in ['basex', 'subsx', 'nonposx'] if k in kwargs} dy = {k: kwargs.pop(k) for k in ['basey', 'subsy', 'nonposy'] @@ -1493,11 +1483,7 @@ def loglog(self, *args, **kwargs): self.set_xscale('log', **dx) self.set_yscale('log', **dy) - b = self._hold - self._hold = True # we've already processed the hold l = self.plot(*args, **kwargs) - self._hold = b # restore the hold - return l # @_preprocess_data() # let 'plot' do the unpacking.. @@ -1542,16 +1528,11 @@ def semilogx(self, *args, **kwargs): **kwargs All parameters supported by `.plot`. """ - if not self._hold: - self.cla() d = {k: kwargs.pop(k) for k in ['basex', 'subsx', 'nonposx'] if k in kwargs} self.set_xscale('log', **d) - b = self._hold - self._hold = True # we've already processed the hold l = self.plot(*args, **kwargs) - self._hold = b # restore the hold return l # @_preprocess_data() # let 'plot' do the unpacking.. @@ -1596,15 +1577,10 @@ def semilogy(self, *args, **kwargs): **kwargs All parameters supported by `.plot`. """ - if not self._hold: - self.cla() d = {k: kwargs.pop(k) for k in ['basey', 'subsy', 'nonposy'] - if k in kwargs} + if k in kwargs} self.set_yscale('log', **d) - b = self._hold - self._hold = True # we've already processed the hold l = self.plot(*args, **kwargs) - self._hold = b # restore the hold return l @@ -1618,8 +1594,6 @@ def acorr(self, x, **kwargs): x : sequence of scalar - hold : bool, optional, *deprecated*, default: True - detrend : callable, optional, default: `mlab.detrend_none` *x* is detrended by the *detrend* callable. Default is no normalization. @@ -1662,8 +1636,6 @@ def acorr(self, x, **kwargs): The cross correlation is performed with :func:`numpy.correlate` with ``mode = 2``. """ - if "hold" in kwargs: - warnings.warn("the 'hold' kwarg is deprecated", mplDeprecation) return self.xcorr(x, x, **kwargs) @_preprocess_data(replace_names=["x", "y"], label_namer="y") @@ -1682,8 +1654,6 @@ def xcorr(self, x, y, normed=True, detrend=mlab.detrend_none, y : sequence of scalars of length n - hold : bool, optional, *deprecated*, default: True - detrend : callable, optional, default: `mlab.detrend_none` *x* is detrended by the *detrend* callable. Default is no normalization. @@ -1727,9 +1697,6 @@ def xcorr(self, x, y, normed=True, detrend=mlab.detrend_none, The cross correlation is performed with :func:`numpy.correlate` with ``mode = 2``. """ - if "hold" in kwargs: - warnings.warn("the 'hold' kwarg is deprecated", mplDeprecation) - Nx = len(x) if Nx != len(y): raise ValueError('x and y must be equal length') @@ -1987,8 +1954,6 @@ def bar(self, *args, **kwargs): "The *left* kwarg to `bar` is deprecated use *x* instead. " "Support for *left* will be removed in Matplotlib 3.0", mplDeprecation, stacklevel=2) - if not self._hold: - self.cla() color = kwargs.pop('color', None) if color is None: color = self._get_patches_for_fill.get_next_color() @@ -2114,9 +2079,6 @@ def bar(self, *args, **kwargs): self.add_patch(r) patches.append(r) - holdstate = self._hold - self._hold = True # ensure hold is on before plotting errorbars - if xerr is not None or yerr is not None: if orientation == 'vertical': # using list comps rather than arrays to preserve unit info @@ -2136,8 +2098,6 @@ def bar(self, *args, **kwargs): else: errorbar = None - self._hold = holdstate # restore previous hold state - if adjust_xlim: xmin, xmax = self.dataLim.intervalx xmin = min(w for w in width if w > 0) @@ -2485,11 +2445,6 @@ def stem(self, *args, **kwargs): next(k for k in kwargs), ) ) - remember_hold = self._hold - if not self._hold: - self.cla() - self._hold = True - # Assume there's at least one data array y = np.asarray(args[0]) args = args[1:] @@ -2565,8 +2520,6 @@ def stem(self, *args, **kwargs): color=basecolor, linestyle=basestyle, marker=basemarker, label="_nolegend_") - self._hold = remember_hold - stem_container = StemContainer((markerline, stemlines, baseline), label=label) self.add_container(stem_container) @@ -2914,10 +2867,6 @@ def errorbar(self, x, y, yerr=None, xerr=None, 'errorevery has to be a strictly positive integer') self._process_unit_info(xdata=x, ydata=y, kwargs=kwargs) - if not self._hold: - self.cla() - holdstate = self._hold - self._hold = True plot_line = (fmt.lower() != 'none') label = kwargs.pop("label", None) @@ -3176,8 +3125,6 @@ def extract_err(err, data): self.add_line(l) self.autoscale_view() - self._hold = holdstate - errorbar_container = ErrorbarContainer((data_line, tuple(caplines), tuple(barcols)), has_xerr=(xerr is not None), @@ -3792,10 +3739,6 @@ def dopatch(xs, ys, **kwargs): elif len(widths) != N: raise ValueError(datashape_message.format("widths")) - # check and save the `hold` state of the current axes - if not self._hold: - self.cla() - holdStatus = self._hold for pos, width, stats in zip(positions, widths, bxpstats): # try to find a new label datalabels.append(stats.get('label', pos)) @@ -3896,9 +3839,6 @@ def dopatch(xs, ys, **kwargs): setticks(positions) setlabels(datalabels) - # reset hold status - self._hold = holdStatus - return dict(whiskers=whiskers, caps=caps, boxes=boxes, medians=medians, fliers=fliers, means=means) @@ -4009,12 +3949,7 @@ def scatter(self, x, y, s=None, c=None, marker=None, cmap=None, norm=None, size matches the size of *x* and *y*. """ - - if not self._hold: - self.cla() - # Process **kwargs to handle aliases, conflicts with explicit kwargs: - facecolors = None edgecolors = kwargs.pop('edgecolor', edgecolors) fc = kwargs.pop('facecolors', None) @@ -4302,10 +4237,6 @@ def hexbin(self, x, y, C=None, gridsize=100, bins=None, %(Collection)s """ - - if not self._hold: - self.cla() - self._process_unit_info(xdata=x, ydata=y, kwargs=kwargs) x, y, C = cbook.delete_masked_points(x, y, C) @@ -4684,9 +4615,6 @@ def _quiver_units(self, args, kw): # args can by a combination if X, Y, U, V, C and all should be replaced @_preprocess_data(replace_all_args=True, label_namer=None) def quiver(self, *args, **kw): - if not self._hold: - self.cla() - # Make sure units are handled for x and y values args = self._quiver_units(args, kw) @@ -4710,8 +4638,6 @@ def streamplot(self, x, y, u, v, density=1, linewidth=None, color=None, minlength=0.1, transform=None, zorder=None, start_points=None, maxlength=4.0, integration_direction='both'): - if not self._hold: - self.cla() stream_container = mstream.streamplot( self, x, y, u, v, density=density, @@ -4737,9 +4663,6 @@ def barbs(self, *args, **kw): """ %(barbs_doc)s """ - if not self._hold: - self.cla() - # Make sure units are handled for x and y values args = self._quiver_units(args, kw) @@ -4786,9 +4709,6 @@ def fill(self, *args, **kwargs): Use :meth:`fill_between` if you would like to fill the region between two curves. """ - if not self._hold: - self.cla() - # For compatibility(!), get aliases from Line2D rather than Patch. kwargs = cbook.normalize_kwargs(kwargs, mlines.Line2D._alias_map) @@ -5290,10 +5210,6 @@ def imshow(self, X, cmap=None, norm=None, aspect=None, `~matplotlib.pyplot.imshow` expects RGB images adopting the straight (unassociated) alpha representation. """ - - if not self._hold: - self.cla() - if norm is not None and not isinstance(norm, mcolors.Normalize): raise ValueError( "'norm' must be an instance of 'mcolors.Normalize'") @@ -5539,10 +5455,6 @@ def pcolor(self, *args, **kwargs): not specified, or if ``X`` and ``Y`` have one more row and column than ``C``. """ - - if not self._hold: - self.cla() - alpha = kwargs.pop('alpha', None) norm = kwargs.pop('norm', None) cmap = kwargs.pop('cmap', None) @@ -5726,9 +5638,6 @@ def pcolormesh(self, *args, **kwargs): %(QuadMesh)s """ - if not self._hold: - self.cla() - alpha = kwargs.pop('alpha', None) norm = kwargs.pop('norm', None) cmap = kwargs.pop('cmap', None) @@ -5872,10 +5781,6 @@ def pcolorfast(self, *args, **kwargs): collection in the general quadrilateral case. """ - - if not self._hold: - self.cla() - alpha = kwargs.pop('alpha', None) norm = kwargs.pop('norm', None) cmap = kwargs.pop('cmap', None) @@ -5978,8 +5883,6 @@ def pcolorfast(self, *args, **kwargs): @_preprocess_data() def contour(self, *args, **kwargs): - if not self._hold: - self.cla() kwargs['filled'] = False contours = mcontour.QuadContourSet(self, *args, **kwargs) self.autoscale_view() @@ -5988,8 +5891,6 @@ def contour(self, *args, **kwargs): @_preprocess_data() def contourf(self, *args, **kwargs): - if not self._hold: - self.cla() kwargs['filled'] = True contours = mcontour.QuadContourSet(self, *args, **kwargs) self.autoscale_view() @@ -6245,9 +6146,6 @@ def hist(self, x, bins=None, range=None, density=None, weights=None, bin_range = range from builtins import range - if not self._hold: - self.cla() - if np.isscalar(x): x = [x] @@ -6743,9 +6641,6 @@ def psd(self, x, NFFT=None, Fs=None, Fc=None, detrend=None, Bendat & Piersol -- Random Data: Analysis and Measurement Procedures, John Wiley & Sons (1986) """ - if not self._hold: - self.cla() - if Fc is None: Fc = 0 @@ -6863,9 +6758,6 @@ def csd(self, x, y, NFFT=None, Fs=None, Fc=None, detrend=None, Bendat & Piersol -- Random Data: Analysis and Measurement Procedures, John Wiley & Sons (1986) """ - if not self._hold: - self.cla() - if Fc is None: Fc = 0 @@ -6970,9 +6862,6 @@ def magnitude_spectrum(self, x, Fs=None, Fc=None, window=None, .. [Notes section required for data comment. See #10189.] """ - if not self._hold: - self.cla() - if Fc is None: Fc = 0 @@ -7067,9 +6956,6 @@ def angle_spectrum(self, x, Fs=None, Fc=None, window=None, .. [Notes section required for data comment. See #10189.] """ - if not self._hold: - self.cla() - if Fc is None: Fc = 0 @@ -7151,9 +7037,6 @@ def phase_spectrum(self, x, Fs=None, Fc=None, window=None, .. [Notes section required for data comment. See #10189.] """ - if not self._hold: - self.cla() - if Fc is None: Fc = 0 @@ -7220,8 +7103,6 @@ def cohere(self, x, y, NFFT=256, Fs=2, Fc=0, detrend=mlab.detrend_none, Bendat & Piersol -- Random Data: Analysis and Measurement Procedures, John Wiley & Sons (1986) """ - if not self._hold: - self.cla() cxy, freqs = mlab.cohere(x=x, y=y, NFFT=NFFT, Fs=Fs, detrend=detrend, window=window, noverlap=noverlap, scale_by_freq=scale_by_freq) @@ -7346,9 +7227,6 @@ def specgram(self, x, NFFT=None, Fs=None, Fc=None, detrend=None, The parameters *detrend* and *scale_by_freq* do only apply when *mode* is set to 'psd'. """ - if not self._hold: - self.cla() - if NFFT is None: NFFT = 256 # same default as in mlab.specgram() if Fc is None: diff --git a/lib/matplotlib/axes/_base.py b/lib/matplotlib/axes/_base.py index 7a27b77f7b15..754f343a52b2 100644 --- a/lib/matplotlib/axes/_base.py +++ b/lib/matplotlib/axes/_base.py @@ -34,10 +34,6 @@ rcParams = matplotlib.rcParams -_hold_msg = """axes.hold is deprecated. - See the API Changes document (http://matplotlib.org/api/api_changes.html) - for more details.""" - def _process_plot_format(fmt): """ @@ -502,11 +498,6 @@ def __init__(self, fig, rect, self._axisbelow = rcParams['axes.axisbelow'] self._rasterization_zorder = None - - self._hold = rcParams['axes.hold'] - if self._hold is None: - self._hold = True - self._connected = {} # a dict from events to (id, func) self.cla() @@ -1231,49 +1222,6 @@ def set_color_cycle(self, clist): else: self.set_prop_cycle('color', clist) - @cbook.deprecated("2.0") - def ishold(self): - """return the HOLD status of the axes - - The `hold` mechanism is deprecated and will be removed in - v3.0. - """ - - return self._hold - - @cbook.deprecated("2.0", message=_hold_msg) - def hold(self, b=None): - """ - Set the hold state. - - The ``hold`` mechanism is deprecated and will be removed in - v3.0. The behavior will remain consistent with the - long-time default value of True. - - If *hold* is *None* (default), toggle the *hold* state. Else - set the *hold* state to boolean value *b*. - - Examples:: - - # toggle hold - hold() - - # turn hold on - hold(True) - - # turn hold off - hold(False) - - When hold is *True*, subsequent plot commands will be added to - the current axes. When hold is *False*, the current axes and - figure will be cleared on the next plot command - - """ - if b is None: - self._hold = not self._hold - else: - self._hold = b - def get_aspect(self): return self._aspect diff --git a/lib/matplotlib/colorbar.py b/lib/matplotlib/colorbar.py index c2ae408221bf..f3c354319d40 100644 --- a/lib/matplotlib/colorbar.py +++ b/lib/matplotlib/colorbar.py @@ -647,15 +647,9 @@ def _add_solids(self, X, Y, C): norm=self.norm, alpha=self.alpha, edgecolors='None') - # Save, set, and restore hold state to keep pcolor from - # clearing the axes. Ordinarily this will not be needed, - # since the axes object should already have hold set. - _hold = self.ax._hold - self.ax._hold = True _log.debug('Setting pcolormesh') col = self.ax.pcolormesh(*args, **kw) - self.ax._hold = _hold - #self.add_observer(col) # We should observe, not be observed... + # self.add_observer(col) # We should observe, not be observed... if self.solids is not None: self.solids.remove() @@ -1443,12 +1437,6 @@ def _add_solids(self, X, Y, C): Draw the colors using :class:`~matplotlib.patches.Patch`; optionally add separators. """ - # Save, set, and restore hold state to keep pcolor from - # clearing the axes. Ordinarily this will not be needed, - # since the axes object should already have hold set. - _hold = self.ax._hold - self.ax._hold = True - kw = {'alpha': self.alpha, } n_segments = len(C) @@ -1494,8 +1482,6 @@ def _add_solids(self, X, Y, C): linewidths=(0.5 * mpl.rcParams['axes.linewidth'],)) self.ax.add_collection(self.dividers) - self.ax._hold = _hold - def colorbar_factory(cax, mappable, **kwargs): """ diff --git a/lib/matplotlib/figure.py b/lib/matplotlib/figure.py index e82858a835b5..59608cc48159 100644 --- a/lib/matplotlib/figure.py +++ b/lib/matplotlib/figure.py @@ -367,10 +367,6 @@ def __init__(self, self._set_artist_props(self.patch) self.patch.set_aa(False) - self._hold = rcParams['axes.hold'] - if self._hold is None: - self._hold = True - self.canvas = None self._suptitle = None @@ -780,25 +776,6 @@ def set_canvas(self, canvas): """ self.canvas = canvas - @cbook.deprecated("2.0") - def hold(self, b=None): - """ - Set the hold state. If hold is None (default), toggle the - hold state. Else set the hold state to boolean value b. - - e.g.:: - - hold() # toggle hold - hold(True) # hold is on - hold(False) # hold is off - - All "hold" machinery is deprecated. - """ - if b is None: - self._hold = not self._hold - else: - self._hold = b - def figimage(self, X, xo=0, yo=0, alpha=None, norm=None, cmap=None, vmin=None, vmax=None, origin=None, resize=False, **kwargs): """ @@ -868,10 +845,6 @@ def figimage(self, X, xo=0, yo=0, alpha=None, norm=None, cmap=None, plt.show() """ - - if not self._hold: - self.clf() - if resize: dpi = self.get_dpi() figsize = [x / dpi for x in (X.shape[1], X.shape[0])] @@ -1922,7 +1895,6 @@ def colorbar(self, mappable, cax=None, ax=None, use_gridspec=True, **kw): cax, kw = cbar.make_axes_gridspec(ax, **kw) else: cax, kw = cbar.make_axes(ax, **kw) - cax._hold = True # need to remove kws that cannot be passed to Colorbar NON_COLORBAR_KEYS = ['fraction', 'pad', 'shrink', 'aspect', 'anchor', diff --git a/lib/matplotlib/pyplot.py b/lib/matplotlib/pyplot.py index 4bf4fc72ac03..cc49d7190a2c 100644 --- a/lib/matplotlib/pyplot.py +++ b/lib/matplotlib/pyplot.py @@ -768,76 +768,7 @@ def figlegend(*args, **kwargs): return gcf().legend(*args, **kwargs) -## Figure and Axes hybrid ## - -_hold_msg = """pyplot.hold is deprecated. - Future behavior will be consistent with the long-time default: - plot commands add elements without first clearing the - Axes and/or Figure.""" - -@deprecated("2.0", message=_hold_msg) -def hold(b=None): - """ - Set the hold state. If *b* is None (default), toggle the - hold state, else set the hold state to boolean value *b*:: - - hold() # toggle hold - hold(True) # hold is on - hold(False) # hold is off - - When *hold* is *True*, subsequent plot commands will add elements to - the current axes. When *hold* is *False*, the current axes and - figure will be cleared on the next plot command. - - """ - - fig = gcf() - ax = fig.gca() - - if b is not None: - b = bool(b) - fig._hold = b - ax._hold = b - - # b=None toggles the hold state, so let's get get the current hold - # state; but should pyplot hold toggle the rc setting - me thinks - # not - b = ax._hold - - # The comment above looks ancient; and probably the line below, - # contrary to the comment, is equally ancient. It will trigger - # a second warning, but "Oh, well...". - rc('axes', hold=b) - -@deprecated("2.0", message=_hold_msg) -def ishold(): - """ - Return the hold status of the current axes. - """ - return gca()._hold - - -@deprecated("2.0", message=_hold_msg) -def over(func, *args, **kwargs): - """ - Call a function with hold(True). - - Calls:: - - func(*args, **kwargs) - - with ``hold(True)`` and then restores the hold state. - - """ - ax = gca() - h = ax._hold - ax._hold = True - func(*args, **kwargs) - ax._hold = h - ## Axes ## - - def axes(arg=None, **kwargs): """ Add an axes to the current figure and make it the current axes. @@ -2482,7 +2413,6 @@ def getname_val(identifier): def _autogen_docstring(base): """Autogenerated wrappers will get their docstring from a base function with an addendum.""" - #msg = "\n\nAdditional kwargs: hold = [True|False] overrides default hold state" msg = '' addendum = docstring.Appender(msg, '\n\n') return lambda func: addendum(docstring.copy_dedent(base)(func)) @@ -2492,19 +2422,7 @@ def _autogen_docstring(base): @_autogen_docstring(Axes.spy) def spy(Z, precision=0, marker=None, markersize=None, aspect='equal', **kwargs): ax = gca() - hold = kwargs.pop('hold', None) - # allow callers to override the hold state by passing hold=True|False - washold = ax._hold - - if hold is not None: - ax._hold = hold - from matplotlib.cbook import mplDeprecation - warnings.warn("The 'hold' keyword argument is deprecated since 2.0.", - mplDeprecation) - try: - ret = ax.spy(Z, precision, marker, markersize, aspect, **kwargs) - finally: - ax._hold = washold + ret = ax.spy(Z, precision, marker, markersize, aspect, **kwargs) if isinstance(ret, cm.ScalarMappable): sci(ret) return ret @@ -2521,143 +2439,59 @@ def spy(Z, precision=0, marker=None, markersize=None, aspect='equal', **kwargs): # Autogenerated by boilerplate.py. Do not edit as changes will be lost. @_autogen_docstring(Axes.acorr) -def acorr(x, hold=None, data=None, **kwargs): +def acorr(x, data=None, **kwargs): ax = gca() - # Deprecated: allow callers to override the hold state - # by passing hold=True|False - washold = ax._hold - - if hold is not None: - ax._hold = hold - from matplotlib.cbook import mplDeprecation - warnings.warn("The 'hold' keyword argument is deprecated since 2.0.", - mplDeprecation) - try: - ret = ax.acorr(x, data=data, **kwargs) - finally: - ax._hold = washold + ret = ax.acorr(x, data=data, **kwargs) return ret # Autogenerated by boilerplate.py. Do not edit as changes will be lost. @_autogen_docstring(Axes.angle_spectrum) def angle_spectrum(x, Fs=None, Fc=None, window=None, pad_to=None, sides=None, - hold=None, data=None, **kwargs): + data=None, **kwargs): ax = gca() - # Deprecated: allow callers to override the hold state - # by passing hold=True|False - washold = ax._hold - - if hold is not None: - ax._hold = hold - from matplotlib.cbook import mplDeprecation - warnings.warn("The 'hold' keyword argument is deprecated since 2.0.", - mplDeprecation) - try: - ret = ax.angle_spectrum(x, Fs=Fs, Fc=Fc, window=window, pad_to=pad_to, + ret = ax.angle_spectrum(x, Fs=Fs, Fc=Fc, window=window, pad_to=pad_to, sides=sides, data=data, **kwargs) - finally: - ax._hold = washold return ret # Autogenerated by boilerplate.py. Do not edit as changes will be lost. @_autogen_docstring(Axes.arrow) -def arrow(x, y, dx, dy, hold=None, **kwargs): +def arrow(x, y, dx, dy, **kwargs): ax = gca() - # Deprecated: allow callers to override the hold state - # by passing hold=True|False - washold = ax._hold - - if hold is not None: - ax._hold = hold - from matplotlib.cbook import mplDeprecation - warnings.warn("The 'hold' keyword argument is deprecated since 2.0.", - mplDeprecation) - try: - ret = ax.arrow(x, y, dx, dy, **kwargs) - finally: - ax._hold = washold + ret = ax.arrow(x, y, dx, dy, **kwargs) return ret # Autogenerated by boilerplate.py. Do not edit as changes will be lost. @_autogen_docstring(Axes.axhline) -def axhline(y=0, xmin=0, xmax=1, hold=None, **kwargs): +def axhline(y=0, xmin=0, xmax=1, **kwargs): ax = gca() - # Deprecated: allow callers to override the hold state - # by passing hold=True|False - washold = ax._hold - - if hold is not None: - ax._hold = hold - from matplotlib.cbook import mplDeprecation - warnings.warn("The 'hold' keyword argument is deprecated since 2.0.", - mplDeprecation) - try: - ret = ax.axhline(y=y, xmin=xmin, xmax=xmax, **kwargs) - finally: - ax._hold = washold + ret = ax.axhline(y=y, xmin=xmin, xmax=xmax, **kwargs) return ret # Autogenerated by boilerplate.py. Do not edit as changes will be lost. @_autogen_docstring(Axes.axhspan) -def axhspan(ymin, ymax, xmin=0, xmax=1, hold=None, **kwargs): +def axhspan(ymin, ymax, xmin=0, xmax=1, **kwargs): ax = gca() - # Deprecated: allow callers to override the hold state - # by passing hold=True|False - washold = ax._hold - - if hold is not None: - ax._hold = hold - from matplotlib.cbook import mplDeprecation - warnings.warn("The 'hold' keyword argument is deprecated since 2.0.", - mplDeprecation) - try: - ret = ax.axhspan(ymin, ymax, xmin=xmin, xmax=xmax, **kwargs) - finally: - ax._hold = washold + ret = ax.axhspan(ymin, ymax, xmin=xmin, xmax=xmax, **kwargs) return ret # Autogenerated by boilerplate.py. Do not edit as changes will be lost. @_autogen_docstring(Axes.axvline) -def axvline(x=0, ymin=0, ymax=1, hold=None, **kwargs): +def axvline(x=0, ymin=0, ymax=1, **kwargs): ax = gca() - # Deprecated: allow callers to override the hold state - # by passing hold=True|False - washold = ax._hold - - if hold is not None: - ax._hold = hold - from matplotlib.cbook import mplDeprecation - warnings.warn("The 'hold' keyword argument is deprecated since 2.0.", - mplDeprecation) - try: - ret = ax.axvline(x=x, ymin=ymin, ymax=ymax, **kwargs) - finally: - ax._hold = washold + ret = ax.axvline(x=x, ymin=ymin, ymax=ymax, **kwargs) return ret # Autogenerated by boilerplate.py. Do not edit as changes will be lost. @_autogen_docstring(Axes.axvspan) -def axvspan(xmin, xmax, ymin=0, ymax=1, hold=None, **kwargs): +def axvspan(xmin, xmax, ymin=0, ymax=1, **kwargs): ax = gca() - # Deprecated: allow callers to override the hold state - # by passing hold=True|False - washold = ax._hold - - if hold is not None: - ax._hold = hold - from matplotlib.cbook import mplDeprecation - warnings.warn("The 'hold' keyword argument is deprecated since 2.0.", - mplDeprecation) - try: - ret = ax.axvspan(xmin, xmax, ymin=ymin, ymax=ymax, **kwargs) - finally: - ax._hold = washold + ret = ax.axvspan(xmin, xmax, ymin=ymin, ymax=ymax, **kwargs) return ret @@ -2665,19 +2499,7 @@ def axvspan(xmin, xmax, ymin=0, ymax=1, hold=None, **kwargs): @_autogen_docstring(Axes.bar) def bar(*args, **kwargs): ax = gca() - # Deprecated: allow callers to override the hold state - # by passing hold=True|False - washold = ax._hold - hold = kwargs.pop('hold', None) - if hold is not None: - ax._hold = hold - from matplotlib.cbook import mplDeprecation - warnings.warn("The 'hold' keyword argument is deprecated since 2.0.", - mplDeprecation) - try: - ret = ax.bar(*args, **kwargs) - finally: - ax._hold = washold + ret = ax.bar(*args, **kwargs) return ret @@ -2685,39 +2507,15 @@ def bar(*args, **kwargs): @_autogen_docstring(Axes.barh) def barh(*args, **kwargs): ax = gca() - # Deprecated: allow callers to override the hold state - # by passing hold=True|False - washold = ax._hold - hold = kwargs.pop('hold', None) - if hold is not None: - ax._hold = hold - from matplotlib.cbook import mplDeprecation - warnings.warn("The 'hold' keyword argument is deprecated since 2.0.", - mplDeprecation) - try: - ret = ax.barh(*args, **kwargs) - finally: - ax._hold = washold + ret = ax.barh(*args, **kwargs) return ret # Autogenerated by boilerplate.py. Do not edit as changes will be lost. @_autogen_docstring(Axes.broken_barh) -def broken_barh(xranges, yrange, hold=None, data=None, **kwargs): +def broken_barh(xranges, yrange, data=None, **kwargs): ax = gca() - # Deprecated: allow callers to override the hold state - # by passing hold=True|False - washold = ax._hold - - if hold is not None: - ax._hold = hold - from matplotlib.cbook import mplDeprecation - warnings.warn("The 'hold' keyword argument is deprecated since 2.0.", - mplDeprecation) - try: - ret = ax.broken_barh(xranges, yrange, data=data, **kwargs) - finally: - ax._hold = washold + ret = ax.broken_barh(xranges, yrange, data=data, **kwargs) return ret @@ -2729,19 +2527,9 @@ def boxplot(x, notch=None, sym=None, vert=None, whis=None, positions=None, showbox=None, showfliers=None, boxprops=None, labels=None, flierprops=None, medianprops=None, meanprops=None, capprops=None, whiskerprops=None, manage_xticks=True, autorange=False, zorder=None, - hold=None, data=None): + data=None): ax = gca() - # Deprecated: allow callers to override the hold state - # by passing hold=True|False - washold = ax._hold - - if hold is not None: - ax._hold = hold - from matplotlib.cbook import mplDeprecation - warnings.warn("The 'hold' keyword argument is deprecated since 2.0.", - mplDeprecation) - try: - ret = ax.boxplot(x, notch=notch, sym=sym, vert=vert, whis=whis, + ret = ax.boxplot(x, notch=notch, sym=sym, vert=vert, whis=whis, positions=positions, widths=widths, patch_artist=patch_artist, bootstrap=bootstrap, usermedians=usermedians, @@ -2754,8 +2542,6 @@ def boxplot(x, notch=None, sym=None, vert=None, whis=None, positions=None, whiskerprops=whiskerprops, manage_xticks=manage_xticks, autorange=autorange, zorder=zorder, data=data) - finally: - ax._hold = washold return ret @@ -2763,24 +2549,12 @@ def boxplot(x, notch=None, sym=None, vert=None, whis=None, positions=None, @_autogen_docstring(Axes.cohere) def cohere(x, y, NFFT=256, Fs=2, Fc=0, detrend=mlab.detrend_none, window=mlab.window_hanning, noverlap=0, pad_to=None, sides='default', - scale_by_freq=None, hold=None, data=None, **kwargs): + scale_by_freq=None, data=None, **kwargs): ax = gca() - # Deprecated: allow callers to override the hold state - # by passing hold=True|False - washold = ax._hold - - if hold is not None: - ax._hold = hold - from matplotlib.cbook import mplDeprecation - warnings.warn("The 'hold' keyword argument is deprecated since 2.0.", - mplDeprecation) - try: - ret = ax.cohere(x, y, NFFT=NFFT, Fs=Fs, Fc=Fc, detrend=detrend, + ret = ax.cohere(x, y, NFFT=NFFT, Fs=Fs, Fc=Fc, detrend=detrend, window=window, noverlap=noverlap, pad_to=pad_to, sides=sides, scale_by_freq=scale_by_freq, data=data, **kwargs) - finally: - ax._hold = washold return ret @@ -2788,19 +2562,7 @@ def cohere(x, y, NFFT=256, Fs=2, Fc=0, detrend=mlab.detrend_none, @_autogen_docstring(Axes.clabel) def clabel(CS, *args, **kwargs): ax = gca() - # Deprecated: allow callers to override the hold state - # by passing hold=True|False - washold = ax._hold - hold = kwargs.pop('hold', None) - if hold is not None: - ax._hold = hold - from matplotlib.cbook import mplDeprecation - warnings.warn("The 'hold' keyword argument is deprecated since 2.0.", - mplDeprecation) - try: - ret = ax.clabel(CS, *args, **kwargs) - finally: - ax._hold = washold + ret = ax.clabel(CS, *args, **kwargs) return ret @@ -2808,19 +2570,7 @@ def clabel(CS, *args, **kwargs): @_autogen_docstring(Axes.contour) def contour(*args, **kwargs): ax = gca() - # Deprecated: allow callers to override the hold state - # by passing hold=True|False - washold = ax._hold - hold = kwargs.pop('hold', None) - if hold is not None: - ax._hold = hold - from matplotlib.cbook import mplDeprecation - warnings.warn("The 'hold' keyword argument is deprecated since 2.0.", - mplDeprecation) - try: - ret = ax.contour(*args, **kwargs) - finally: - ax._hold = washold + ret = ax.contour(*args, **kwargs) if ret._A is not None: sci(ret) return ret @@ -2828,19 +2578,7 @@ def contour(*args, **kwargs): @_autogen_docstring(Axes.contourf) def contourf(*args, **kwargs): ax = gca() - # Deprecated: allow callers to override the hold state - # by passing hold=True|False - washold = ax._hold - hold = kwargs.pop('hold', None) - if hold is not None: - ax._hold = hold - from matplotlib.cbook import mplDeprecation - warnings.warn("The 'hold' keyword argument is deprecated since 2.0.", - mplDeprecation) - try: - ret = ax.contourf(*args, **kwargs) - finally: - ax._hold = washold + ret = ax.contourf(*args, **kwargs) if ret._A is not None: sci(ret) return ret @@ -2848,24 +2586,12 @@ def contourf(*args, **kwargs): @_autogen_docstring(Axes.csd) def csd(x, y, NFFT=None, Fs=None, Fc=None, detrend=None, window=None, noverlap=None, pad_to=None, sides=None, scale_by_freq=None, - return_line=None, hold=None, data=None, **kwargs): + return_line=None, data=None, **kwargs): ax = gca() - # Deprecated: allow callers to override the hold state - # by passing hold=True|False - washold = ax._hold - - if hold is not None: - ax._hold = hold - from matplotlib.cbook import mplDeprecation - warnings.warn("The 'hold' keyword argument is deprecated since 2.0.", - mplDeprecation) - try: - ret = ax.csd(x, y, NFFT=NFFT, Fs=Fs, Fc=Fc, detrend=detrend, + ret = ax.csd(x, y, NFFT=NFFT, Fs=Fs, Fc=Fc, detrend=detrend, window=window, noverlap=noverlap, pad_to=pad_to, sides=sides, scale_by_freq=scale_by_freq, return_line=return_line, data=data, **kwargs) - finally: - ax._hold = washold return ret @@ -2874,51 +2600,27 @@ def csd(x, y, NFFT=None, Fs=None, Fc=None, detrend=None, window=None, def errorbar(x, y, yerr=None, xerr=None, fmt='', ecolor=None, elinewidth=None, capsize=None, barsabove=False, lolims=False, uplims=False, xlolims=False, xuplims=False, errorevery=1, capthick=None, - hold=None, data=None, **kwargs): + data=None, **kwargs): ax = gca() - # Deprecated: allow callers to override the hold state - # by passing hold=True|False - washold = ax._hold - - if hold is not None: - ax._hold = hold - from matplotlib.cbook import mplDeprecation - warnings.warn("The 'hold' keyword argument is deprecated since 2.0.", - mplDeprecation) - try: - ret = ax.errorbar(x, y, yerr=yerr, xerr=xerr, fmt=fmt, ecolor=ecolor, + ret = ax.errorbar(x, y, yerr=yerr, xerr=xerr, fmt=fmt, ecolor=ecolor, elinewidth=elinewidth, capsize=capsize, barsabove=barsabove, lolims=lolims, uplims=uplims, xlolims=xlolims, xuplims=xuplims, errorevery=errorevery, capthick=capthick, data=data, **kwargs) - finally: - ax._hold = washold return ret # Autogenerated by boilerplate.py. Do not edit as changes will be lost. @_autogen_docstring(Axes.eventplot) def eventplot(positions, orientation='horizontal', lineoffsets=1, linelengths=1, - linewidths=None, colors=None, linestyles='solid', hold=None, - data=None, **kwargs): + linewidths=None, colors=None, linestyles='solid', data=None, + **kwargs): ax = gca() - # Deprecated: allow callers to override the hold state - # by passing hold=True|False - washold = ax._hold - - if hold is not None: - ax._hold = hold - from matplotlib.cbook import mplDeprecation - warnings.warn("The 'hold' keyword argument is deprecated since 2.0.", - mplDeprecation) - try: - ret = ax.eventplot(positions, orientation=orientation, + ret = ax.eventplot(positions, orientation=orientation, lineoffsets=lineoffsets, linelengths=linelengths, linewidths=linewidths, colors=colors, linestyles=linestyles, data=data, **kwargs) - finally: - ax._hold = washold return ret @@ -2926,64 +2628,28 @@ def eventplot(positions, orientation='horizontal', lineoffsets=1, linelengths=1, @_autogen_docstring(Axes.fill) def fill(*args, **kwargs): ax = gca() - # Deprecated: allow callers to override the hold state - # by passing hold=True|False - washold = ax._hold - hold = kwargs.pop('hold', None) - if hold is not None: - ax._hold = hold - from matplotlib.cbook import mplDeprecation - warnings.warn("The 'hold' keyword argument is deprecated since 2.0.", - mplDeprecation) - try: - ret = ax.fill(*args, **kwargs) - finally: - ax._hold = washold + ret = ax.fill(*args, **kwargs) return ret # Autogenerated by boilerplate.py. Do not edit as changes will be lost. @_autogen_docstring(Axes.fill_between) def fill_between(x, y1, y2=0, where=None, interpolate=False, step=None, - hold=None, data=None, **kwargs): + data=None, **kwargs): ax = gca() - # Deprecated: allow callers to override the hold state - # by passing hold=True|False - washold = ax._hold - - if hold is not None: - ax._hold = hold - from matplotlib.cbook import mplDeprecation - warnings.warn("The 'hold' keyword argument is deprecated since 2.0.", - mplDeprecation) - try: - ret = ax.fill_between(x, y1, y2=y2, where=where, + ret = ax.fill_between(x, y1, y2=y2, where=where, interpolate=interpolate, step=step, data=data, **kwargs) - finally: - ax._hold = washold return ret # Autogenerated by boilerplate.py. Do not edit as changes will be lost. @_autogen_docstring(Axes.fill_betweenx) def fill_betweenx(y, x1, x2=0, where=None, step=None, interpolate=False, - hold=None, data=None, **kwargs): + data=None, **kwargs): ax = gca() - # Deprecated: allow callers to override the hold state - # by passing hold=True|False - washold = ax._hold - - if hold is not None: - ax._hold = hold - from matplotlib.cbook import mplDeprecation - warnings.warn("The 'hold' keyword argument is deprecated since 2.0.", - mplDeprecation) - try: - ret = ax.fill_betweenx(y, x1, x2=x2, where=where, step=step, + ret = ax.fill_betweenx(y, x1, x2=x2, where=where, step=step, interpolate=interpolate, data=data, **kwargs) - finally: - ax._hold = washold return ret @@ -2992,27 +2658,15 @@ def fill_betweenx(y, x1, x2=0, where=None, step=None, interpolate=False, def hexbin(x, y, C=None, gridsize=100, bins=None, xscale='linear', yscale='linear', extent=None, cmap=None, norm=None, vmin=None, vmax=None, alpha=None, linewidths=None, edgecolors='face', - reduce_C_function=np.mean, mincnt=None, marginals=False, hold=None, - data=None, **kwargs): + reduce_C_function=np.mean, mincnt=None, marginals=False, data=None, + **kwargs): ax = gca() - # Deprecated: allow callers to override the hold state - # by passing hold=True|False - washold = ax._hold - - if hold is not None: - ax._hold = hold - from matplotlib.cbook import mplDeprecation - warnings.warn("The 'hold' keyword argument is deprecated since 2.0.", - mplDeprecation) - try: - ret = ax.hexbin(x, y, C=C, gridsize=gridsize, bins=bins, xscale=xscale, + ret = ax.hexbin(x, y, C=C, gridsize=gridsize, bins=bins, xscale=xscale, yscale=yscale, extent=extent, cmap=cmap, norm=norm, vmin=vmin, vmax=vmax, alpha=alpha, linewidths=linewidths, edgecolors=edgecolors, reduce_C_function=reduce_C_function, mincnt=mincnt, marginals=marginals, data=data, **kwargs) - finally: - ax._hold = washold sci(ret) return ret @@ -3021,70 +2675,34 @@ def hexbin(x, y, C=None, gridsize=100, bins=None, xscale='linear', def hist(x, bins=None, range=None, density=None, weights=None, cumulative=False, bottom=None, histtype='bar', align='mid', orientation='vertical', rwidth=None, log=False, color=None, label=None, stacked=False, - normed=None, hold=None, data=None, **kwargs): + normed=None, data=None, **kwargs): ax = gca() - # Deprecated: allow callers to override the hold state - # by passing hold=True|False - washold = ax._hold - - if hold is not None: - ax._hold = hold - from matplotlib.cbook import mplDeprecation - warnings.warn("The 'hold' keyword argument is deprecated since 2.0.", - mplDeprecation) - try: - ret = ax.hist(x, bins=bins, range=range, density=density, + ret = ax.hist(x, bins=bins, range=range, density=density, weights=weights, cumulative=cumulative, bottom=bottom, histtype=histtype, align=align, orientation=orientation, rwidth=rwidth, log=log, color=color, label=label, stacked=stacked, normed=normed, data=data, **kwargs) - finally: - ax._hold = washold return ret # Autogenerated by boilerplate.py. Do not edit as changes will be lost. @_autogen_docstring(Axes.hist2d) def hist2d(x, y, bins=10, range=None, normed=False, weights=None, cmin=None, - cmax=None, hold=None, data=None, **kwargs): + cmax=None, data=None, **kwargs): ax = gca() - # Deprecated: allow callers to override the hold state - # by passing hold=True|False - washold = ax._hold - - if hold is not None: - ax._hold = hold - from matplotlib.cbook import mplDeprecation - warnings.warn("The 'hold' keyword argument is deprecated since 2.0.", - mplDeprecation) - try: - ret = ax.hist2d(x, y, bins=bins, range=range, normed=normed, + ret = ax.hist2d(x, y, bins=bins, range=range, normed=normed, weights=weights, cmin=cmin, cmax=cmax, data=data, **kwargs) - finally: - ax._hold = washold sci(ret[-1]) return ret # Autogenerated by boilerplate.py. Do not edit as changes will be lost. @_autogen_docstring(Axes.hlines) -def hlines(y, xmin, xmax, colors='k', linestyles='solid', label='', hold=None, - data=None, **kwargs): +def hlines(y, xmin, xmax, colors='k', linestyles='solid', label='', data=None, + **kwargs): ax = gca() - # Deprecated: allow callers to override the hold state - # by passing hold=True|False - washold = ax._hold - - if hold is not None: - ax._hold = hold - from matplotlib.cbook import mplDeprecation - warnings.warn("The 'hold' keyword argument is deprecated since 2.0.", - mplDeprecation) - try: - ret = ax.hlines(y, xmin, xmax, colors=colors, linestyles=linestyles, + ret = ax.hlines(y, xmin, xmax, colors=colors, linestyles=linestyles, label=label, data=data, **kwargs) - finally: - ax._hold = washold return ret @@ -3093,26 +2711,14 @@ def hlines(y, xmin, xmax, colors='k', linestyles='solid', label='', hold=None, def imshow(X, cmap=None, norm=None, aspect=None, interpolation=None, alpha=None, vmin=None, vmax=None, origin=None, extent=None, shape=None, filternorm=1, filterrad=4.0, imlim=None, resample=None, url=None, - hold=None, data=None, **kwargs): + data=None, **kwargs): ax = gca() - # Deprecated: allow callers to override the hold state - # by passing hold=True|False - washold = ax._hold - - if hold is not None: - ax._hold = hold - from matplotlib.cbook import mplDeprecation - warnings.warn("The 'hold' keyword argument is deprecated since 2.0.", - mplDeprecation) - try: - ret = ax.imshow(X, cmap=cmap, norm=norm, aspect=aspect, + ret = ax.imshow(X, cmap=cmap, norm=norm, aspect=aspect, interpolation=interpolation, alpha=alpha, vmin=vmin, vmax=vmax, origin=origin, extent=extent, shape=shape, filternorm=filternorm, filterrad=filterrad, imlim=imlim, resample=resample, url=url, data=data, **kwargs) - finally: - ax._hold = washold sci(ret) return ret @@ -3120,42 +2726,18 @@ def imshow(X, cmap=None, norm=None, aspect=None, interpolation=None, alpha=None, @_autogen_docstring(Axes.loglog) def loglog(*args, **kwargs): ax = gca() - # Deprecated: allow callers to override the hold state - # by passing hold=True|False - washold = ax._hold - hold = kwargs.pop('hold', None) - if hold is not None: - ax._hold = hold - from matplotlib.cbook import mplDeprecation - warnings.warn("The 'hold' keyword argument is deprecated since 2.0.", - mplDeprecation) - try: - ret = ax.loglog(*args, **kwargs) - finally: - ax._hold = washold + ret = ax.loglog(*args, **kwargs) return ret # Autogenerated by boilerplate.py. Do not edit as changes will be lost. @_autogen_docstring(Axes.magnitude_spectrum) def magnitude_spectrum(x, Fs=None, Fc=None, window=None, pad_to=None, - sides=None, scale=None, hold=None, data=None, **kwargs): + sides=None, scale=None, data=None, **kwargs): ax = gca() - # Deprecated: allow callers to override the hold state - # by passing hold=True|False - washold = ax._hold - - if hold is not None: - ax._hold = hold - from matplotlib.cbook import mplDeprecation - warnings.warn("The 'hold' keyword argument is deprecated since 2.0.", - mplDeprecation) - try: - ret = ax.magnitude_spectrum(x, Fs=Fs, Fc=Fc, window=window, + ret = ax.magnitude_spectrum(x, Fs=Fs, Fc=Fc, window=window, pad_to=pad_to, sides=sides, scale=scale, data=data, **kwargs) - finally: - ax._hold = washold return ret @@ -3163,19 +2745,7 @@ def magnitude_spectrum(x, Fs=None, Fc=None, window=None, pad_to=None, @_autogen_docstring(Axes.pcolor) def pcolor(*args, **kwargs): ax = gca() - # Deprecated: allow callers to override the hold state - # by passing hold=True|False - washold = ax._hold - hold = kwargs.pop('hold', None) - if hold is not None: - ax._hold = hold - from matplotlib.cbook import mplDeprecation - warnings.warn("The 'hold' keyword argument is deprecated since 2.0.", - mplDeprecation) - try: - ret = ax.pcolor(*args, **kwargs) - finally: - ax._hold = washold + ret = ax.pcolor(*args, **kwargs) sci(ret) return ret @@ -3183,41 +2753,17 @@ def pcolor(*args, **kwargs): @_autogen_docstring(Axes.pcolormesh) def pcolormesh(*args, **kwargs): ax = gca() - # Deprecated: allow callers to override the hold state - # by passing hold=True|False - washold = ax._hold - hold = kwargs.pop('hold', None) - if hold is not None: - ax._hold = hold - from matplotlib.cbook import mplDeprecation - warnings.warn("The 'hold' keyword argument is deprecated since 2.0.", - mplDeprecation) - try: - ret = ax.pcolormesh(*args, **kwargs) - finally: - ax._hold = washold + ret = ax.pcolormesh(*args, **kwargs) sci(ret) return ret # Autogenerated by boilerplate.py. Do not edit as changes will be lost. @_autogen_docstring(Axes.phase_spectrum) def phase_spectrum(x, Fs=None, Fc=None, window=None, pad_to=None, sides=None, - hold=None, data=None, **kwargs): + data=None, **kwargs): ax = gca() - # Deprecated: allow callers to override the hold state - # by passing hold=True|False - washold = ax._hold - - if hold is not None: - ax._hold = hold - from matplotlib.cbook import mplDeprecation - warnings.warn("The 'hold' keyword argument is deprecated since 2.0.", - mplDeprecation) - try: - ret = ax.phase_spectrum(x, Fs=Fs, Fc=Fc, window=window, pad_to=pad_to, + ret = ax.phase_spectrum(x, Fs=Fs, Fc=Fc, window=window, pad_to=pad_to, sides=sides, data=data, **kwargs) - finally: - ax._hold = washold return ret @@ -3226,26 +2772,14 @@ def phase_spectrum(x, Fs=None, Fc=None, window=None, pad_to=None, sides=None, def pie(x, explode=None, labels=None, colors=None, autopct=None, pctdistance=0.6, shadow=False, labeldistance=1.1, startangle=None, radius=None, counterclock=True, wedgeprops=None, textprops=None, - center=(0, 0), frame=False, rotatelabels=False, hold=None, data=None): + center=(0, 0), frame=False, rotatelabels=False, data=None): ax = gca() - # Deprecated: allow callers to override the hold state - # by passing hold=True|False - washold = ax._hold - - if hold is not None: - ax._hold = hold - from matplotlib.cbook import mplDeprecation - warnings.warn("The 'hold' keyword argument is deprecated since 2.0.", - mplDeprecation) - try: - ret = ax.pie(x, explode=explode, labels=labels, colors=colors, + ret = ax.pie(x, explode=explode, labels=labels, colors=colors, autopct=autopct, pctdistance=pctdistance, shadow=shadow, labeldistance=labeldistance, startangle=startangle, radius=radius, counterclock=counterclock, wedgeprops=wedgeprops, textprops=textprops, center=center, frame=frame, rotatelabels=rotatelabels, data=data) - finally: - ax._hold = washold return ret @@ -3253,41 +2787,17 @@ def pie(x, explode=None, labels=None, colors=None, autopct=None, @_autogen_docstring(Axes.plot) def plot(*args, **kwargs): ax = gca() - # Deprecated: allow callers to override the hold state - # by passing hold=True|False - washold = ax._hold - hold = kwargs.pop('hold', None) - if hold is not None: - ax._hold = hold - from matplotlib.cbook import mplDeprecation - warnings.warn("The 'hold' keyword argument is deprecated since 2.0.", - mplDeprecation) - try: - ret = ax.plot(*args, **kwargs) - finally: - ax._hold = washold + ret = ax.plot(*args, **kwargs) return ret # Autogenerated by boilerplate.py. Do not edit as changes will be lost. @_autogen_docstring(Axes.plot_date) -def plot_date(x, y, fmt='o', tz=None, xdate=True, ydate=False, hold=None, - data=None, **kwargs): +def plot_date(x, y, fmt='o', tz=None, xdate=True, ydate=False, data=None, + **kwargs): ax = gca() - # Deprecated: allow callers to override the hold state - # by passing hold=True|False - washold = ax._hold - - if hold is not None: - ax._hold = hold - from matplotlib.cbook import mplDeprecation - warnings.warn("The 'hold' keyword argument is deprecated since 2.0.", - mplDeprecation) - try: - ret = ax.plot_date(x, y, fmt=fmt, tz=tz, xdate=xdate, ydate=ydate, + ret = ax.plot_date(x, y, fmt=fmt, tz=tz, xdate=xdate, ydate=ydate, data=data, **kwargs) - finally: - ax._hold = washold return ret @@ -3295,24 +2805,12 @@ def plot_date(x, y, fmt='o', tz=None, xdate=True, ydate=False, hold=None, @_autogen_docstring(Axes.psd) def psd(x, NFFT=None, Fs=None, Fc=None, detrend=None, window=None, noverlap=None, pad_to=None, sides=None, scale_by_freq=None, - return_line=None, hold=None, data=None, **kwargs): + return_line=None, data=None, **kwargs): ax = gca() - # Deprecated: allow callers to override the hold state - # by passing hold=True|False - washold = ax._hold - - if hold is not None: - ax._hold = hold - from matplotlib.cbook import mplDeprecation - warnings.warn("The 'hold' keyword argument is deprecated since 2.0.", - mplDeprecation) - try: - ret = ax.psd(x, NFFT=NFFT, Fs=Fs, Fc=Fc, detrend=detrend, + ret = ax.psd(x, NFFT=NFFT, Fs=Fs, Fc=Fc, detrend=detrend, window=window, noverlap=noverlap, pad_to=pad_to, sides=sides, scale_by_freq=scale_by_freq, return_line=return_line, data=data, **kwargs) - finally: - ax._hold = washold return ret @@ -3320,19 +2818,7 @@ def psd(x, NFFT=None, Fs=None, Fc=None, detrend=None, window=None, @_autogen_docstring(Axes.quiver) def quiver(*args, **kw): ax = gca() - # Deprecated: allow callers to override the hold state - # by passing hold=True|False - washold = ax._hold - hold = kw.pop('hold', None) - if hold is not None: - ax._hold = hold - from matplotlib.cbook import mplDeprecation - warnings.warn("The 'hold' keyword argument is deprecated since 2.0.", - mplDeprecation) - try: - ret = ax.quiver(*args, **kw) - finally: - ax._hold = washold + ret = ax.quiver(*args, **kw) sci(ret) return ret @@ -3340,19 +2826,7 @@ def quiver(*args, **kw): @_autogen_docstring(Axes.quiverkey) def quiverkey(*args, **kw): ax = gca() - # Deprecated: allow callers to override the hold state - # by passing hold=True|False - washold = ax._hold - hold = kw.pop('hold', None) - if hold is not None: - ax._hold = hold - from matplotlib.cbook import mplDeprecation - warnings.warn("The 'hold' keyword argument is deprecated since 2.0.", - mplDeprecation) - try: - ret = ax.quiverkey(*args, **kw) - finally: - ax._hold = washold + ret = ax.quiverkey(*args, **kw) return ret @@ -3360,24 +2834,12 @@ def quiverkey(*args, **kw): @_autogen_docstring(Axes.scatter) def scatter(x, y, s=None, c=None, marker=None, cmap=None, norm=None, vmin=None, vmax=None, alpha=None, linewidths=None, verts=None, edgecolors=None, - hold=None, data=None, **kwargs): + data=None, **kwargs): ax = gca() - # Deprecated: allow callers to override the hold state - # by passing hold=True|False - washold = ax._hold - - if hold is not None: - ax._hold = hold - from matplotlib.cbook import mplDeprecation - warnings.warn("The 'hold' keyword argument is deprecated since 2.0.", - mplDeprecation) - try: - ret = ax.scatter(x, y, s=s, c=c, marker=marker, cmap=cmap, norm=norm, + ret = ax.scatter(x, y, s=s, c=c, marker=marker, cmap=cmap, norm=norm, vmin=vmin, vmax=vmax, alpha=alpha, linewidths=linewidths, verts=verts, edgecolors=edgecolors, data=data, **kwargs) - finally: - ax._hold = washold sci(ret) return ret @@ -3385,19 +2847,7 @@ def scatter(x, y, s=None, c=None, marker=None, cmap=None, norm=None, vmin=None, @_autogen_docstring(Axes.semilogx) def semilogx(*args, **kwargs): ax = gca() - # Deprecated: allow callers to override the hold state - # by passing hold=True|False - washold = ax._hold - hold = kwargs.pop('hold', None) - if hold is not None: - ax._hold = hold - from matplotlib.cbook import mplDeprecation - warnings.warn("The 'hold' keyword argument is deprecated since 2.0.", - mplDeprecation) - try: - ret = ax.semilogx(*args, **kwargs) - finally: - ax._hold = washold + ret = ax.semilogx(*args, **kwargs) return ret @@ -3405,19 +2855,7 @@ def semilogx(*args, **kwargs): @_autogen_docstring(Axes.semilogy) def semilogy(*args, **kwargs): ax = gca() - # Deprecated: allow callers to override the hold state - # by passing hold=True|False - washold = ax._hold - hold = kwargs.pop('hold', None) - if hold is not None: - ax._hold = hold - from matplotlib.cbook import mplDeprecation - warnings.warn("The 'hold' keyword argument is deprecated since 2.0.", - mplDeprecation) - try: - ret = ax.semilogy(*args, **kwargs) - finally: - ax._hold = washold + ret = ax.semilogy(*args, **kwargs) return ret @@ -3426,25 +2864,13 @@ def semilogy(*args, **kwargs): def specgram(x, NFFT=None, Fs=None, Fc=None, detrend=None, window=None, noverlap=None, cmap=None, xextent=None, pad_to=None, sides=None, scale_by_freq=None, mode=None, scale=None, vmin=None, vmax=None, - hold=None, data=None, **kwargs): + data=None, **kwargs): ax = gca() - # Deprecated: allow callers to override the hold state - # by passing hold=True|False - washold = ax._hold - - if hold is not None: - ax._hold = hold - from matplotlib.cbook import mplDeprecation - warnings.warn("The 'hold' keyword argument is deprecated since 2.0.", - mplDeprecation) - try: - ret = ax.specgram(x, NFFT=NFFT, Fs=Fs, Fc=Fc, detrend=detrend, + ret = ax.specgram(x, NFFT=NFFT, Fs=Fs, Fc=Fc, detrend=detrend, window=window, noverlap=noverlap, cmap=cmap, xextent=xextent, pad_to=pad_to, sides=sides, scale_by_freq=scale_by_freq, mode=mode, scale=scale, vmin=vmin, vmax=vmax, data=data, **kwargs) - finally: - ax._hold = washold sci(ret[-1]) return ret @@ -3452,19 +2878,7 @@ def specgram(x, NFFT=None, Fs=None, Fc=None, detrend=None, window=None, @_autogen_docstring(Axes.stackplot) def stackplot(x, *args, **kwargs): ax = gca() - # Deprecated: allow callers to override the hold state - # by passing hold=True|False - washold = ax._hold - hold = kwargs.pop('hold', None) - if hold is not None: - ax._hold = hold - from matplotlib.cbook import mplDeprecation - warnings.warn("The 'hold' keyword argument is deprecated since 2.0.", - mplDeprecation) - try: - ret = ax.stackplot(x, *args, **kwargs) - finally: - ax._hold = washold + ret = ax.stackplot(x, *args, **kwargs) return ret @@ -3472,19 +2886,7 @@ def stackplot(x, *args, **kwargs): @_autogen_docstring(Axes.stem) def stem(*args, **kwargs): ax = gca() - # Deprecated: allow callers to override the hold state - # by passing hold=True|False - washold = ax._hold - hold = kwargs.pop('hold', None) - if hold is not None: - ax._hold = hold - from matplotlib.cbook import mplDeprecation - warnings.warn("The 'hold' keyword argument is deprecated since 2.0.", - mplDeprecation) - try: - ret = ax.stem(*args, **kwargs) - finally: - ax._hold = washold + ret = ax.stem(*args, **kwargs) return ret @@ -3492,19 +2894,7 @@ def stem(*args, **kwargs): @_autogen_docstring(Axes.step) def step(x, y, *args, **kwargs): ax = gca() - # Deprecated: allow callers to override the hold state - # by passing hold=True|False - washold = ax._hold - hold = kwargs.pop('hold', None) - if hold is not None: - ax._hold = hold - from matplotlib.cbook import mplDeprecation - warnings.warn("The 'hold' keyword argument is deprecated since 2.0.", - mplDeprecation) - try: - ret = ax.step(x, y, *args, **kwargs) - finally: - ax._hold = washold + ret = ax.step(x, y, *args, **kwargs) return ret @@ -3513,19 +2903,9 @@ def step(x, y, *args, **kwargs): def streamplot(x, y, u, v, density=1, linewidth=None, color=None, cmap=None, norm=None, arrowsize=1, arrowstyle='-|>', minlength=0.1, transform=None, zorder=None, start_points=None, maxlength=4.0, - integration_direction='both', hold=None, data=None): + integration_direction='both', data=None): ax = gca() - # Deprecated: allow callers to override the hold state - # by passing hold=True|False - washold = ax._hold - - if hold is not None: - ax._hold = hold - from matplotlib.cbook import mplDeprecation - warnings.warn("The 'hold' keyword argument is deprecated since 2.0.", - mplDeprecation) - try: - ret = ax.streamplot(x, y, u, v, density=density, linewidth=linewidth, + ret = ax.streamplot(x, y, u, v, density=density, linewidth=linewidth, color=color, cmap=cmap, norm=norm, arrowsize=arrowsize, arrowstyle=arrowstyle, minlength=minlength, transform=transform, @@ -3533,8 +2913,6 @@ def streamplot(x, y, u, v, density=1, linewidth=None, color=None, cmap=None, maxlength=maxlength, integration_direction=integration_direction, data=data) - finally: - ax._hold = washold sci(ret.lines) return ret @@ -3542,19 +2920,7 @@ def streamplot(x, y, u, v, density=1, linewidth=None, color=None, cmap=None, @_autogen_docstring(Axes.tricontour) def tricontour(*args, **kwargs): ax = gca() - # Deprecated: allow callers to override the hold state - # by passing hold=True|False - washold = ax._hold - hold = kwargs.pop('hold', None) - if hold is not None: - ax._hold = hold - from matplotlib.cbook import mplDeprecation - warnings.warn("The 'hold' keyword argument is deprecated since 2.0.", - mplDeprecation) - try: - ret = ax.tricontour(*args, **kwargs) - finally: - ax._hold = washold + ret = ax.tricontour(*args, **kwargs) if ret._A is not None: sci(ret) return ret @@ -3562,19 +2928,7 @@ def tricontour(*args, **kwargs): @_autogen_docstring(Axes.tricontourf) def tricontourf(*args, **kwargs): ax = gca() - # Deprecated: allow callers to override the hold state - # by passing hold=True|False - washold = ax._hold - hold = kwargs.pop('hold', None) - if hold is not None: - ax._hold = hold - from matplotlib.cbook import mplDeprecation - warnings.warn("The 'hold' keyword argument is deprecated since 2.0.", - mplDeprecation) - try: - ret = ax.tricontourf(*args, **kwargs) - finally: - ax._hold = washold + ret = ax.tricontourf(*args, **kwargs) if ret._A is not None: sci(ret) return ret @@ -3582,19 +2936,7 @@ def tricontourf(*args, **kwargs): @_autogen_docstring(Axes.tripcolor) def tripcolor(*args, **kwargs): ax = gca() - # Deprecated: allow callers to override the hold state - # by passing hold=True|False - washold = ax._hold - hold = kwargs.pop('hold', None) - if hold is not None: - ax._hold = hold - from matplotlib.cbook import mplDeprecation - warnings.warn("The 'hold' keyword argument is deprecated since 2.0.", - mplDeprecation) - try: - ret = ax.tripcolor(*args, **kwargs) - finally: - ax._hold = washold + ret = ax.tripcolor(*args, **kwargs) sci(ret) return ret @@ -3602,19 +2944,7 @@ def tripcolor(*args, **kwargs): @_autogen_docstring(Axes.triplot) def triplot(*args, **kwargs): ax = gca() - # Deprecated: allow callers to override the hold state - # by passing hold=True|False - washold = ax._hold - hold = kwargs.pop('hold', None) - if hold is not None: - ax._hold = hold - from matplotlib.cbook import mplDeprecation - warnings.warn("The 'hold' keyword argument is deprecated since 2.0.", - mplDeprecation) - try: - ret = ax.triplot(*args, **kwargs) - finally: - ax._hold = washold + ret = ax.triplot(*args, **kwargs) return ret @@ -3622,69 +2952,33 @@ def triplot(*args, **kwargs): @_autogen_docstring(Axes.violinplot) def violinplot(dataset, positions=None, vert=True, widths=0.5, showmeans=False, showextrema=True, showmedians=False, points=100, bw_method=None, - hold=None, data=None): + data=None): ax = gca() - # Deprecated: allow callers to override the hold state - # by passing hold=True|False - washold = ax._hold - - if hold is not None: - ax._hold = hold - from matplotlib.cbook import mplDeprecation - warnings.warn("The 'hold' keyword argument is deprecated since 2.0.", - mplDeprecation) - try: - ret = ax.violinplot(dataset, positions=positions, vert=vert, + ret = ax.violinplot(dataset, positions=positions, vert=vert, widths=widths, showmeans=showmeans, showextrema=showextrema, showmedians=showmedians, points=points, bw_method=bw_method, data=data) - finally: - ax._hold = washold return ret # Autogenerated by boilerplate.py. Do not edit as changes will be lost. @_autogen_docstring(Axes.vlines) -def vlines(x, ymin, ymax, colors='k', linestyles='solid', label='', hold=None, - data=None, **kwargs): +def vlines(x, ymin, ymax, colors='k', linestyles='solid', label='', data=None, + **kwargs): ax = gca() - # Deprecated: allow callers to override the hold state - # by passing hold=True|False - washold = ax._hold - - if hold is not None: - ax._hold = hold - from matplotlib.cbook import mplDeprecation - warnings.warn("The 'hold' keyword argument is deprecated since 2.0.", - mplDeprecation) - try: - ret = ax.vlines(x, ymin, ymax, colors=colors, linestyles=linestyles, + ret = ax.vlines(x, ymin, ymax, colors=colors, linestyles=linestyles, label=label, data=data, **kwargs) - finally: - ax._hold = washold return ret # Autogenerated by boilerplate.py. Do not edit as changes will be lost. @_autogen_docstring(Axes.xcorr) def xcorr(x, y, normed=True, detrend=mlab.detrend_none, usevlines=True, - maxlags=10, hold=None, data=None, **kwargs): + maxlags=10, data=None, **kwargs): ax = gca() - # Deprecated: allow callers to override the hold state - # by passing hold=True|False - washold = ax._hold - - if hold is not None: - ax._hold = hold - from matplotlib.cbook import mplDeprecation - warnings.warn("The 'hold' keyword argument is deprecated since 2.0.", - mplDeprecation) - try: - ret = ax.xcorr(x, y, normed=normed, detrend=detrend, + ret = ax.xcorr(x, y, normed=normed, detrend=detrend, usevlines=usevlines, maxlags=maxlags, data=data, **kwargs) - finally: - ax._hold = washold return ret @@ -3692,19 +2986,7 @@ def xcorr(x, y, normed=True, detrend=mlab.detrend_none, usevlines=True, @_autogen_docstring(Axes.barbs) def barbs(*args, **kw): ax = gca() - # Deprecated: allow callers to override the hold state - # by passing hold=True|False - washold = ax._hold - hold = kw.pop('hold', None) - if hold is not None: - ax._hold = hold - from matplotlib.cbook import mplDeprecation - warnings.warn("The 'hold' keyword argument is deprecated since 2.0.", - mplDeprecation) - try: - ret = ax.barbs(*args, **kw) - finally: - ax._hold = washold + ret = ax.barbs(*args, **kw) return ret diff --git a/lib/matplotlib/rcsetup.py b/lib/matplotlib/rcsetup.py index 6b650febdd7c..64b52453823a 100644 --- a/lib/matplotlib/rcsetup.py +++ b/lib/matplotlib/rcsetup.py @@ -145,15 +145,6 @@ def validate_bool_maybe_none(b): raise ValueError('Could not convert "%s" to boolean' % b) -def deprecate_axes_hold(value): - if value is None: - return None # converted to True where accessed in figure.py, - # axes/_base.py - warnings.warn("axes.hold is deprecated, will be removed in 3.0", - mplDeprecation) - return validate_bool(value) - - def validate_float(s): """convert s to float or raise""" try: @@ -1155,7 +1146,6 @@ def _validate_linestyle(ls): # axes props 'axes.axisbelow': ['line', validate_axisbelow], - 'axes.hold': [None, deprecate_axes_hold], 'axes.facecolor': ['white', validate_color], # background color 'axes.edgecolor': ['black', validate_color], # edge color 'axes.linewidth': [0.8, validate_float], # edge linewidth diff --git a/lib/matplotlib/tri/tricontour.py b/lib/matplotlib/tri/tricontour.py index 9cbb88fab327..2d651123ccea 100644 --- a/lib/matplotlib/tri/tricontour.py +++ b/lib/matplotlib/tri/tricontour.py @@ -265,15 +265,13 @@ def tricontour(ax, *args, **kwargs): the minimum value of the *z* array, then that minimum value will be included in the lowest interval. """ - if not ax._hold: - ax.cla() kwargs['filled'] = False return TriContourSet(ax, *args, **kwargs) def tricontourf(ax, *args, **kwargs): - if not ax._hold: - ax.cla() kwargs['filled'] = True return TriContourSet(ax, *args, **kwargs) + + tricontourf.__doc__ = tricontour.__doc__ diff --git a/lib/mpl_toolkits/axes_grid1/axes_grid.py b/lib/mpl_toolkits/axes_grid1/axes_grid.py index a304f1eeed11..c19e9cedd0cc 100644 --- a/lib/mpl_toolkits/axes_grid1/axes_grid.py +++ b/lib/mpl_toolkits/axes_grid1/axes_grid.py @@ -47,7 +47,6 @@ def colorbar(self, mappable, **kwargs): else: kwargs["ticks"] = locator - self._hold = True if self.orientation in ["top", "bottom"]: orientation = "horizontal" else: @@ -769,4 +768,3 @@ def _update_locators(self): AxesGrid = ImageGrid - diff --git a/lib/mpl_toolkits/axes_grid1/colorbar.py b/lib/mpl_toolkits/axes_grid1/colorbar.py index c2227bf379dc..a9e0361f6780 100644 --- a/lib/mpl_toolkits/axes_grid1/colorbar.py +++ b/lib/mpl_toolkits/axes_grid1/colorbar.py @@ -814,7 +814,6 @@ def colorbar(mappable, cax=None, ax=None, **kw): ax = plt.gca() if cax is None: cax, kw = make_axes(ax, **kw) - cax._hold = True cb = Colorbar(cax, mappable, **kw) def on_changed(m): diff --git a/tools/boilerplate.py b/tools/boilerplate.py index a2222dc7b4ca..21e66d4802e7 100644 --- a/tools/boilerplate.py +++ b/tools/boilerplate.py @@ -44,19 +44,7 @@ @_autogen_docstring(Axes.%(func)s) def %(func)s(%(argspec)s): %(ax)s = gca() - # Deprecated: allow callers to override the hold state - # by passing hold=True|False - %(washold)s = %(ax)s._hold -%(sethold)s - if hold is not None: - %(ax)s._hold = hold - from matplotlib.cbook import mplDeprecation - warnings.warn("The 'hold' keyword argument is deprecated since 2.0.", - mplDeprecation) - try: - %(ret)s = %(ax)s.%(func)s(%(call)s) - finally: - %(ax)s._hold = %(washold)s + %(ret)s = %(ax)s.%(func)s(%(call)s) %(mappable)s return %(ret)s """ @@ -268,19 +256,9 @@ def format_value(value): join_with = '\n' + ' ' * (18 + len(func)) call = join_with.join(text_wrapper.wrap(call)) - # Add a hold keyword argument if needed (fmt is PLOT_TEMPLATE) and - # possible (if *args is used, we can't just add a hold - # argument in front of it since it would gobble one of the - # arguments the user means to pass via *args) - if varargs: - sethold = " hold = %(varkw)s.pop('hold', None)" % locals() - elif fmt is PLOT_TEMPLATE: - args.append('hold') + if not varargs and fmt is PLOT_TEMPLATE and has_data: + args.append('data') defaults = defaults + (None,) - if has_data: - args.append('data') - defaults = defaults + (None,) - sethold = '' # Now we can build the argspec for defining the wrapper argspec = inspect.formatargspec(args, varargs, varkw, defaults, From 929e87c97ab892ae42e5f90041702e42e045743c Mon Sep 17 00:00:00 2001 From: David Stansby Date: Fri, 16 Feb 2018 23:00:24 +0000 Subject: [PATCH 2/4] Remove hold refs from axes doc --- doc/api/axes_api.rst | 2 -- 1 file changed, 2 deletions(-) diff --git a/doc/api/axes_api.rst b/doc/api/axes_api.rst index c7a363b08a1e..30deeec7e62b 100644 --- a/doc/api/axes_api.rst +++ b/doc/api/axes_api.rst @@ -652,8 +652,6 @@ Other Axes.get_default_bbox_extra_artists Axes.get_transformed_clip_path_and_affine Axes.has_data - Axes.hold - Axes.ishold Inheritance From cd743b4e6c7e15660870c7b73108e9969a5e7f29 Mon Sep 17 00:00:00 2001 From: David Stansby Date: Sun, 18 Feb 2018 11:08:22 +0000 Subject: [PATCH 3/4] Remove last (hopefully) _hold --- lib/matplotlib/tri/tripcolor.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib/matplotlib/tri/tripcolor.py b/lib/matplotlib/tri/tripcolor.py index 0fb36ae83e0f..d384a9d4808f 100644 --- a/lib/matplotlib/tri/tripcolor.py +++ b/lib/matplotlib/tri/tripcolor.py @@ -45,9 +45,6 @@ def tripcolor(ax, *args, **kwargs): The remaining kwargs are the same as for :meth:`~matplotlib.axes.Axes.pcolor`. """ - if not ax._hold: - ax.cla() - alpha = kwargs.pop('alpha', 1.0) norm = kwargs.pop('norm', None) cmap = kwargs.pop('cmap', None) From 34cb25147832ba83f3badb1f9b0a18c913e71f5f Mon Sep 17 00:00:00 2001 From: David Stansby Date: Tue, 20 Feb 2018 09:04:24 +0000 Subject: [PATCH 4/4] Add API notes --- doc/api/next_api_changes/2018-02-20-DS-hold.rst | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 doc/api/next_api_changes/2018-02-20-DS-hold.rst diff --git a/doc/api/next_api_changes/2018-02-20-DS-hold.rst b/doc/api/next_api_changes/2018-02-20-DS-hold.rst new file mode 100644 index 000000000000..6e75643adf7b --- /dev/null +++ b/doc/api/next_api_changes/2018-02-20-DS-hold.rst @@ -0,0 +1,7 @@ +Hold machinery removed +---------------------- + +Setting or unsetting ``hold`` (deprecated in version 2.1) has now +been completely removed. Matplotlib now always behaves as if ``hold=True``. +To clear an axes you can manually use :meth:`~.axes.Axes.cla()`, +or to clear an entire figure use :meth:`~.figure.Figure.clf()`.