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

Skip to content

Commit eba349a

Browse files
authored
Merge pull request #15211 from anntzer/backends_cleanups
Various backend cleanups.
2 parents 2f6a7a4 + 4a9f6a8 commit eba349a

File tree

6 files changed

+6
-20
lines changed

6 files changed

+6
-20
lines changed

lib/matplotlib/backends/backend_pdf.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2498,14 +2498,9 @@ class FigureCanvasPdf(FigureCanvasBase):
24982498
----------
24992499
figure : `matplotlib.figure.Figure`
25002500
A high-level Figure instance
2501-
25022501
"""
25032502

25042503
fixed_dpi = 72
2505-
2506-
def draw(self):
2507-
pass
2508-
25092504
filetypes = {'pdf': 'Portable Document Format'}
25102505

25112506
def get_default_filetype(self):

lib/matplotlib/backends/backend_pgf.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -946,14 +946,12 @@ def get_renderer(self):
946946
return RendererPgf(self.figure, None)
947947

948948

949-
class FigureManagerPgf(FigureManagerBase):
950-
pass
949+
FigureManagerPgf = FigureManagerBase
951950

952951

953952
@_Backend.export
954953
class _BackendPgf(_Backend):
955954
FigureCanvas = FigureCanvasPgf
956-
FigureManager = FigureManagerPgf
957955

958956

959957
def _cleanup_all():

lib/matplotlib/backends/backend_ps.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -748,10 +748,6 @@ def swap_if_landscape(self, shape):
748748

749749
class FigureCanvasPS(FigureCanvasBase):
750750
fixed_dpi = 72
751-
752-
def draw(self):
753-
pass
754-
755751
filetypes = {'ps': 'Postscript',
756752
'eps': 'Encapsulated Postscript'}
757753

lib/matplotlib/backends/backend_qt5.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,6 @@ def __init__(self, figure):
222222
_create_qApp()
223223
super().__init__(figure=figure)
224224

225-
self.figure = figure
226225
# We don't want to scale up the figure DPI more than once.
227226
# Note, we don't handle a signal for changing DPI yet.
228227
figure._original_dpi = figure.dpi

lib/matplotlib/backends/backend_template.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,7 @@ def draw(self):
200200

201201
# If the file type is not in the base set of filetypes,
202202
# you should add it to the class-scope filetypes dictionary as follows:
203-
filetypes = FigureCanvasBase.filetypes.copy()
204-
filetypes['foo'] = 'My magic Foo format'
203+
filetypes = {**FigureCanvasBase.filetypes, 'foo': 'My magic Foo format'}
205204

206205
def print_foo(self, filename, *args, **kwargs):
207206
"""

lib/matplotlib/backends/backend_wx.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -512,12 +512,11 @@ class _FigureCanvasWxBase(FigureCanvasBase, wx.Panel):
512512

513513
def __init__(self, parent, id, figure):
514514
"""
515-
Initialise a FigureWx instance.
515+
Initialize a FigureWx instance.
516516
517-
- Initialise the FigureCanvasBase and wxPanel parents.
518-
- Set event handlers for:
519-
EVT_SIZE (Resize event)
520-
EVT_PAINT (Paint event)
517+
- Initialize the FigureCanvasBase and wxPanel parents.
518+
- Set event handlers for resize, paint, and keyboard and mouse
519+
interaction.
521520
"""
522521

523522
FigureCanvasBase.__init__(self, figure)

0 commit comments

Comments
 (0)