diff --git a/lib/matplotlib/backends/backend_pdf.py b/lib/matplotlib/backends/backend_pdf.py index 7e3b600196bf..f4e254a0e9cb 100644 --- a/lib/matplotlib/backends/backend_pdf.py +++ b/lib/matplotlib/backends/backend_pdf.py @@ -2498,14 +2498,9 @@ class FigureCanvasPdf(FigureCanvasBase): ---------- figure : `matplotlib.figure.Figure` A high-level Figure instance - """ fixed_dpi = 72 - - def draw(self): - pass - filetypes = {'pdf': 'Portable Document Format'} def get_default_filetype(self): diff --git a/lib/matplotlib/backends/backend_pgf.py b/lib/matplotlib/backends/backend_pgf.py index da124a2dde69..49427b1f6fbf 100644 --- a/lib/matplotlib/backends/backend_pgf.py +++ b/lib/matplotlib/backends/backend_pgf.py @@ -952,14 +952,12 @@ def get_renderer(self): return RendererPgf(self.figure, None, dummy=True) -class FigureManagerPgf(FigureManagerBase): - pass +FigureManagerPgf = FigureManagerBase @_Backend.export class _BackendPgf(_Backend): FigureCanvas = FigureCanvasPgf - FigureManager = FigureManagerPgf def _cleanup_all(): diff --git a/lib/matplotlib/backends/backend_ps.py b/lib/matplotlib/backends/backend_ps.py index 4c6848110237..958ad6204210 100644 --- a/lib/matplotlib/backends/backend_ps.py +++ b/lib/matplotlib/backends/backend_ps.py @@ -748,10 +748,6 @@ def swap_if_landscape(self, shape): class FigureCanvasPS(FigureCanvasBase): fixed_dpi = 72 - - def draw(self): - pass - filetypes = {'ps': 'Postscript', 'eps': 'Encapsulated Postscript'} diff --git a/lib/matplotlib/backends/backend_qt5.py b/lib/matplotlib/backends/backend_qt5.py index 6b8a7ceb034b..46b684bba928 100644 --- a/lib/matplotlib/backends/backend_qt5.py +++ b/lib/matplotlib/backends/backend_qt5.py @@ -222,7 +222,6 @@ def __init__(self, figure): _create_qApp() super().__init__(figure=figure) - self.figure = figure # We don't want to scale up the figure DPI more than once. # Note, we don't handle a signal for changing DPI yet. figure._original_dpi = figure.dpi diff --git a/lib/matplotlib/backends/backend_template.py b/lib/matplotlib/backends/backend_template.py index 299a8aac9c1a..19c8c822274b 100644 --- a/lib/matplotlib/backends/backend_template.py +++ b/lib/matplotlib/backends/backend_template.py @@ -200,8 +200,7 @@ def draw(self): # If the file type is not in the base set of filetypes, # you should add it to the class-scope filetypes dictionary as follows: - filetypes = FigureCanvasBase.filetypes.copy() - filetypes['foo'] = 'My magic Foo format' + filetypes = {**FigureCanvasBase.filetypes, 'foo': 'My magic Foo format'} def print_foo(self, filename, *args, **kwargs): """ diff --git a/lib/matplotlib/backends/backend_wx.py b/lib/matplotlib/backends/backend_wx.py index a01f57aa2bfe..6b94f8c399ac 100644 --- a/lib/matplotlib/backends/backend_wx.py +++ b/lib/matplotlib/backends/backend_wx.py @@ -512,12 +512,11 @@ class _FigureCanvasWxBase(FigureCanvasBase, wx.Panel): def __init__(self, parent, id, figure): """ - Initialise a FigureWx instance. + Initialize a FigureWx instance. - - Initialise the FigureCanvasBase and wxPanel parents. - - Set event handlers for: - EVT_SIZE (Resize event) - EVT_PAINT (Paint event) + - Initialize the FigureCanvasBase and wxPanel parents. + - Set event handlers for resize, paint, and keyboard and mouse + interaction. """ FigureCanvasBase.__init__(self, figure)