Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Various backend cleanups.#15211

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
QuLogic merged 1 commit intomatplotlib:masterfromanntzer:backends_cleanups
Mar 14, 2020
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletionslib/matplotlib/backends/backend_pdf.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -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):
Expand Down
4 changes: 1 addition & 3 deletionslib/matplotlib/backends/backend_pgf.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -952,14 +952,12 @@ def get_renderer(self):
return RendererPgf(self.figure, None, dummy=True)


class FigureManagerPgf(FigureManagerBase):
pass
FigureManagerPgf = FigureManagerBase
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I wouldn't do this because you don't create aFigureManagerPgf type with that, so that

>>> mgr = FigureManagerPgf()>>> type(mgr)<class 'FigureManagerBase'>

which is a bit confusing.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

this is consistent with FigureManagerPS, FigureManagerPDF and FigureManagerSVG, and was discussed in#9551 (review).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Still not convinced this is a good approach, but accepting as precedenced.



@_Backend.export
class _BackendPgf(_Backend):
FigureCanvas = FigureCanvasPgf
FigureManager = FigureManagerPgf


def _cleanup_all():
Expand Down
4 changes: 0 additions & 4 deletionslib/matplotlib/backends/backend_ps.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -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'}

Expand Down
1 change: 0 additions & 1 deletionlib/matplotlib/backends/backend_qt5.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -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
Expand Down
3 changes: 1 addition & 2 deletionslib/matplotlib/backends/backend_template.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -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):
"""
Expand Down
9 changes: 4 additions & 5 deletionslib/matplotlib/backends/backend_wx.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -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)
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp