diff --git a/doc/api/next_api_changes/2019-03-18-AL.rst b/doc/api/next_api_changes/2019-03-18-AL.rst new file mode 100644 index 000000000000..dd8b9a46925b --- /dev/null +++ b/doc/api/next_api_changes/2019-03-18-AL.rst @@ -0,0 +1,9 @@ +Deprecations +```````````` + +The following (unused and never updated) attributes are deprecated: +``NavigationToolbar2QT.buttons``, ``Line2D.verticalOffset``, ``Quiver.keytext``, +``Quiver.keyvec``, ``SpanSelector.buttonDown``. + +The ``interp_at_native`` parameter to ``BboxImage``, which has no effect since +Matplotlib 2.0, is deprecated. diff --git a/lib/matplotlib/backends/backend_pdf.py b/lib/matplotlib/backends/backend_pdf.py index 404059b6b642..2b9ec53660f1 100644 --- a/lib/matplotlib/backends/backend_pdf.py +++ b/lib/matplotlib/backends/backend_pdf.py @@ -486,7 +486,6 @@ def __init__(self, filename, metadata=None): self.fontNames = {} # maps filenames to internal font names self.nextFont = 1 # next free internal font name self.dviFontInfo = {} # maps dvi font names to embedding information - self._texFontMap = None # maps TeX font names to PostScript fonts # differently encoded Type-1 fonts may share the same descriptor self.type1Descriptors = {} self.used_characters = {} diff --git a/lib/matplotlib/backends/backend_qt5.py b/lib/matplotlib/backends/backend_qt5.py index 4551e9e04b9c..e9539c2fed08 100644 --- a/lib/matplotlib/backends/backend_qt5.py +++ b/lib/matplotlib/backends/backend_qt5.py @@ -711,8 +711,6 @@ def _init_toolbar(self): 'Customize', self.edit_parameters) a.setToolTip('Edit axis, curve and image parameters') - self.buttons = {} - # Add the x,y location widget at the right side of the toolbar # The stretch factor is 1 which means any resizing of the toolbar # will resize this label instead of the buttons. @@ -736,6 +734,11 @@ def _init_toolbar(self): self.setIconSize(QtCore.QSize(24, 24)) self.layout().setSpacing(12) + @cbook.deprecated("3.1") + @property + def buttons(self): + return {} + if is_pyqt5(): # For some reason, self.setMinimumHeight doesn't seem to carry over to # the actual sizeHint, so override it instead in order to make the diff --git a/lib/matplotlib/backends/backend_svg.py b/lib/matplotlib/backends/backend_svg.py index c9a202808cba..a4520daf7959 100644 --- a/lib/matplotlib/backends/backend_svg.py +++ b/lib/matplotlib/backends/backend_svg.py @@ -283,7 +283,6 @@ def __init__(self, width, height, svgwriter, basename=None, image_dpi=72): self.basename = basename self._imaged = {} self._clipd = OrderedDict() - self._char_defs = {} self._markers = {} self._path_collection_id = 0 self._imaged = {} diff --git a/lib/matplotlib/backends/backend_wx.py b/lib/matplotlib/backends/backend_wx.py index 0519b04d1300..95499700ccc2 100644 --- a/lib/matplotlib/backends/backend_wx.py +++ b/lib/matplotlib/backends/backend_wx.py @@ -425,7 +425,6 @@ def __init__(self, bitmap, renderer): self.gfx_ctx = gfx_ctx self._pen = wx.Pen('BLACK', 1, wx.SOLID) gfx_ctx.SetPen(self._pen) - self._style = wx.SOLID self.renderer = renderer def select(self): @@ -1595,7 +1594,6 @@ def __init__(self, toolmanager, parent, style=wx.TB_HORIZONTAL): wx.ToolBar.__init__(self, parent, -1, style=style) self._toolitems = {} self._groups = {} - self._last = None def add_toolitem( self, name, group, position, image_file, description, toggle): @@ -1624,7 +1622,6 @@ def handler(event): else: control.Bind(wx.EVT_LEFT_DOWN, handler) - self._last = tool self._toolitems.setdefault(name, []) group.insert(position, tool) self._toolitems[name].append((tool, handler)) diff --git a/lib/matplotlib/contour.py b/lib/matplotlib/contour.py index a83d38a43d80..46ba5f8defb1 100644 --- a/lib/matplotlib/contour.py +++ b/lib/matplotlib/contour.py @@ -1066,7 +1066,6 @@ def _process_args(self, *args, **kwargs): self.allkinds = len(args) > 2 and args[2] or None self.zmax = np.max(self.levels) self.zmin = np.min(self.levels) - self._auto = False # Check lengths of levels and allsegs. if self.filled: @@ -1152,7 +1151,6 @@ def _autolev(self, N): one contour line, but two filled regions, and therefore three levels to provide boundaries for both regions. """ - self._auto = True if self.locator is None: if self.logscale: self.locator = ticker.LogLocator() @@ -1186,7 +1184,6 @@ def _contour_level_args(self, z, args): """ Determine the contour levels and store in self.levels. """ - self._auto = False if self.levels is None: if len(args) == 0: levels_arg = 7 # Default, hard-wired. diff --git a/lib/matplotlib/image.py b/lib/matplotlib/image.py index 69b54bca6a80..9ce3c80edd3f 100644 --- a/lib/matplotlib/image.py +++ b/lib/matplotlib/image.py @@ -1258,6 +1258,8 @@ def set_data(self, A): class BboxImage(_ImageBase): """The Image class whose size is determined by the given bbox.""" + + @cbook._delete_parameter("3.1", "interp_at_native") def __init__(self, bbox, cmap=None, norm=None, @@ -1273,16 +1275,7 @@ def __init__(self, bbox, cmap is a colors.Colormap instance norm is a colors.Normalize instance to map luminance to 0-1 - interp_at_native is a flag that determines whether or not - interpolation should still be applied when the image is - displayed at its native resolution. A common use case for this - is when displaying an image for annotational purposes; it is - treated similarly to Photoshop (interpolation is only used when - displaying the image at non-native resolutions). - - kwargs are an optional list of Artist keyword args - """ super().__init__( None, @@ -1297,9 +1290,14 @@ def __init__(self, bbox, ) self.bbox = bbox - self.interp_at_native = interp_at_native + self._interp_at_native = interp_at_native self._transform = IdentityTransform() + @cbook.deprecated("3.1") + @property + def interp_at_native(self): + return self._interp_at_native + def get_transform(self): return self._transform diff --git a/lib/matplotlib/legend.py b/lib/matplotlib/legend.py index 3f5e2928c779..9edc79647e57 100644 --- a/lib/matplotlib/legend.py +++ b/lib/matplotlib/legend.py @@ -593,7 +593,6 @@ def __init__(self, parent, handles, labels, title_fontsize = rcParams['legend.title_fontsize'] tprop = FontProperties(size=title_fontsize) self.set_title(title, prop=tprop) - self._last_fontsize_points = self._fontsize self._draggable = None def _set_artist_props(self, a): diff --git a/lib/matplotlib/lines.py b/lib/matplotlib/lines.py index aafb56ac2415..f7a791dcb469 100644 --- a/lib/matplotlib/lines.py +++ b/lib/matplotlib/lines.py @@ -400,8 +400,6 @@ def __init__(self, xdata, ydata, self.set_markeredgecolor(markeredgecolor) self.set_markeredgewidth(markeredgewidth) - self.verticalOffset = None - # update kwargs before updating data to give the caller a # chance to init axes (and hence unit support) self.update(kwargs) @@ -424,6 +422,11 @@ def __init__(self, xdata, ydata, self.set_data(xdata, ydata) + @cbook.deprecated("3.1") + @property + def verticalOffset(self): + return None + def contains(self, mouseevent): """ Test whether the mouse event occurred on the line. The pick diff --git a/lib/matplotlib/patches.py b/lib/matplotlib/patches.py index 708afffd7f35..9dc4cc4fb03b 100644 --- a/lib/matplotlib/patches.py +++ b/lib/matplotlib/patches.py @@ -91,7 +91,6 @@ def __init__(self, self.set_hatch(hatch) self.set_capstyle(capstyle) self.set_joinstyle(joinstyle) - self._combined_transform = transforms.IdentityTransform() if len(kwargs): self.update(kwargs) diff --git a/lib/matplotlib/patheffects.py b/lib/matplotlib/patheffects.py index 63ad0899f05a..b63d26652199 100644 --- a/lib/matplotlib/patheffects.py +++ b/lib/matplotlib/patheffects.py @@ -249,10 +249,6 @@ def __init__(self, offset=(2, -2), #: The dictionary of keywords to update the graphics collection with. self._gc = kwargs - #: The offset transform object. The offset isn't calculated yet - #: as we don't know how big the figure will be in pixels. - self._offset_tran = mtransforms.Affine2D() - def draw_path(self, renderer, gc, tpath, affine, rgbFace): """ Overrides the standard draw_path to add the shadow offset and @@ -313,7 +309,6 @@ def __init__(self, offset=(2, -2), **kwargs Extra keywords are stored and passed through to :meth:`AbstractPathEffect._update_gc`. - """ super().__init__(offset) if shadow_color is None: @@ -322,14 +317,9 @@ def __init__(self, offset=(2, -2), self._shadow_color = mcolors.to_rgba(shadow_color) self._alpha = alpha self._rho = rho - #: The dictionary of keywords to update the graphics collection with. self._gc = kwargs - #: The offset transform object. The offset isn't calculated yet - #: as we don't know how big the figure will be in pixels. - self._offset_tran = mtransforms.Affine2D() - def draw_path(self, renderer, gc, tpath, affine, rgbFace): """ Overrides the standard draw_path to add the shadow offset and diff --git a/lib/matplotlib/quiver.py b/lib/matplotlib/quiver.py index 611676fedec4..1fc3c63dab3c 100644 --- a/lib/matplotlib/quiver.py +++ b/lib/matplotlib/quiver.py @@ -475,9 +475,6 @@ def __init__(self, ax, *args, self.set_UVC(U, V, C) self._initialized = False - self.keyvec = None - self.keytext = None - # try to prevent closure over the real self weak_self = weakref.ref(self) @@ -499,6 +496,16 @@ def on_dpi_change(fig): def color(self): return self.get_facecolor() + @cbook.deprecated("3.1") + @property + def keyvec(self): + return None + + @cbook.deprecated("3.1") + @property + def keytext(self): + return None + def remove(self): """ Overload the remove method diff --git a/lib/matplotlib/table.py b/lib/matplotlib/table.py index 55eadc51b0c1..7af44778ee30 100644 --- a/lib/matplotlib/table.py +++ b/lib/matplotlib/table.py @@ -322,10 +322,8 @@ def __init__(self, ax, loc=None, bbox=None, **kwargs): # use axes coords self.set_transform(ax.transAxes) - self._texts = [] self._cells = {} self._edges = None - self._autoRows = [] self._autoColumns = [] self._autoFontsize = True self.update(kwargs) diff --git a/lib/matplotlib/testing/compare.py b/lib/matplotlib/testing/compare.py index ed996060d76d..34b0d5cbf437 100644 --- a/lib/matplotlib/testing/compare.py +++ b/lib/matplotlib/testing/compare.py @@ -173,7 +173,6 @@ def _read_until(self, terminator): class _GSConverter(_Converter): def __call__(self, orig, dest): if not self._proc: - self._stdout = TemporaryFile() self._proc = subprocess.Popen( [mpl._get_executable_info("gs").executable, "-dNOPAUSE", "-sDEVICE=png16m"], diff --git a/lib/matplotlib/widgets.py b/lib/matplotlib/widgets.py index d421aee7f654..4097f1e94688 100644 --- a/lib/matplotlib/widgets.py +++ b/lib/matplotlib/widgets.py @@ -1837,7 +1837,6 @@ def _release(self, event): """on button release event""" if self.pressv is None: return - self.buttonDown = False self.rect.set_visible(False) @@ -1865,6 +1864,11 @@ def _release(self, event): self.pressv = None return False + @cbook.deprecated("3.1") + @property + def buttonDown(self): + return False + def _onmove(self, event): """on motion notify event""" if self.pressv is None: