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

Small cleanups to backend docs.#15539

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
timhoffm merged 1 commit intomatplotlib:masterfromanntzer:backend-docs
Oct 27, 2019
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
6 changes: 3 additions & 3 deletionslib/matplotlib/backends/backend_gtk3.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -51,8 +51,8 @@


class TimerGTK3(TimerBase):
'''
Subclass of:class:`backend_bases.TimerBase` using GTK3 for timer events.
"""
Subclass of`.TimerBase` using GTK3 for timer events.

Attributes
----------
Expand All@@ -65,8 +65,8 @@ class TimerGTK3(TimerBase):
Stores list of (func, args) tuples that will be called upon timer
events. This list can be manipulated directly, or the functions
`add_callback` and `remove_callback` can be used.
"""

'''
def _timer_start(self):
# Need to stop it, otherwise we potentially leak a timer id that will
# never be stopped.
Expand Down
9 changes: 4 additions & 5 deletionslib/matplotlib/backends/backend_macosx.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -19,9 +19,9 @@


class TimerMac(_macosx.Timer, TimerBase):
'''
Subclass of:class:`backend_bases.TimerBase` that uses CoreFoundation
run loops for timerevents.
"""
Subclass of`.TimerBase` that uses CoreFoundation run loops for timer
events.

Attributes
----------
Expand All@@ -34,8 +34,7 @@ class TimerMac(_macosx.Timer, TimerBase):
Stores list of (func, args) tuples that will be called upon timer
events. This list can be manipulated directly, or the functions
`add_callback` and `remove_callback` can be used.

'''
"""
# completely implemented at the C-level (in _macosx.Timer)


Expand Down
24 changes: 11 additions & 13 deletionslib/matplotlib/backends/backend_pdf.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -2399,9 +2399,8 @@ class PdfPages:

Notes
-----
In reality :class:`PdfPages` is a thin wrapper around :class:`PdfFile`, in
order to avoid confusion when using :func:`~matplotlib.pyplot.savefig` and
forgetting the format argument.
In reality `PdfPages` is a thin wrapper around `PdfFile`, in order to avoid
confusion when using `~.pyplot.savefig` and forgetting the format argument.
"""
__slots__ = ('_file', 'keep_empty')

Expand All@@ -2412,9 +2411,9 @@ def __init__(self, filename, keep_empty=True, metadata=None):
Parameters
----------
filename : str or path-like or file-like
Plots using:meth:`PdfPages.savefig` will be written to a file at
thislocation. The file is opened at once and any older file with
thesame name is overwritten.
Plots using `PdfPages.savefig` will be written to a file at this
location. The file is opened at once and any older file with the
same name is overwritten.
keep_empty : bool, optional
If set to False, then empty pdf files will be deleted automatically
when closed.
Expand DownExpand Up@@ -2462,18 +2461,17 @@ def infodict(self):

def savefig(self, figure=None, **kwargs):
"""
Saves a:class:`~matplotlib.figure.Figure` to this file as a new page.
Saves a`.Figure` to this file as a new page.

Any other keyword arguments are passed to
:meth:`~matplotlib.figure.Figure.savefig`.
Any other keyword arguments are passed to `~.Figure.savefig`.

Parameters
----------
figure ::class:`~matplotlib.figure.Figure` or int, optional
figure :`.Figure` or int, optional
Specifies what figure is saved to file. If not specified, the
active figure is saved. If a:class:`~matplotlib.figure.Figure`
instance is provided, thisfigure is saved. If an int is specified,
the figure instance tosave is looked up by number.
active figure is saved. If a`.Figure` instance is provided, this
figure is saved. If an int is specified, the figure instance to
save is looked up by number.
"""
if not isinstance(figure, Figure):
if figure is None:
Expand Down
17 changes: 8 additions & 9 deletionslib/matplotlib/backends/backend_pgf.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1017,8 +1017,8 @@ def __init__(self, filename, *, keep_empty=True, metadata=None):
Parameters
----------
filename : str or path-like
Plots using:meth:`PdfPages.savefig` will be written to a file at
thislocation. Any older file with the same name is overwritten.
Plots using `PdfPages.savefig` will be written to a file at this
location. Any older file with the same name is overwritten.
keep_empty : bool, optional
If set to False, then empty pdf files will be deleted automatically
when closed.
Expand DownExpand Up@@ -1127,18 +1127,17 @@ def _run_latex(self):

def savefig(self, figure=None, **kwargs):
"""
Saves a:class:`~matplotlib.figure.Figure` to this file as a new page.
Saves a`.Figure` to this file as a new page.

Any other keyword arguments are passed to
:meth:`~matplotlib.figure.Figure.savefig`.
Any other keyword arguments are passed to `~.Figure.savefig`.

Parameters
----------
figure ::class:`~matplotlib.figure.Figure` or int, optional
figure :`.Figure` or int, optional
Specifies what figure is saved to file. If not specified, the
active figure is saved. If a:class:`~matplotlib.figure.Figure`
instance is provided, thisfigure is saved. If an int is specified,
the figure instance tosave is looked up by number.
active figure is saved. If a`.Figure` instance is provided, this
figure is saved. If an int is specified, the figure instance to
save is looked up by number.
"""
if not isinstance(figure, Figure):
if figure is None:
Expand Down
7 changes: 3 additions & 4 deletionslib/matplotlib/backends/backend_qt5.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -175,8 +175,8 @@ def wrapper(self, *args, **kwargs):


class TimerQT(TimerBase):
'''
Subclass of:class:`backend_bases.TimerBase` that uses Qt timer events.
"""
Subclass of`.TimerBase` that uses Qt timer events.

Attributes
----------
Expand All@@ -189,8 +189,7 @@ class TimerQT(TimerBase):
Stores list of (func, args) tuples that will be called upon timer
events. This list can be manipulated directly, or the functions
`add_callback` and `remove_callback` can be used.

'''
"""

def __init__(self, *args, **kwargs):
TimerBase.__init__(self, *args, **kwargs)
Expand Down
6 changes: 3 additions & 3 deletionslib/matplotlib/backends/backend_qt5agg.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -21,7 +21,8 @@ def __init__(self, figure):
super().__init__(figure=figure)

def paintEvent(self, event):
"""Copy the image from the Agg canvas to the qt.drawable.
"""
Copy the image from the Agg canvas to the qt.drawable.

In Qt, all drawing should be done inside of here when a widget is
shown onscreen.
Expand DownExpand Up@@ -78,8 +79,7 @@ def paintEvent(self, event):
painter.end()

def blit(self, bbox=None):
"""Blit the region in bbox.
"""
# docstring inherited
# If bbox is None, blit the entire canvas. Otherwise
# blit only the area defined by the bbox.
if bbox is None and self.figure:
Expand Down
7 changes: 3 additions & 4 deletionslib/matplotlib/backends/backend_wx.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -100,8 +100,8 @@ def raise_msg_to_str(msg):


class TimerWx(TimerBase):
'''
Subclass of:class:`backend_bases.TimerBase` that uses WxTimer events.
"""
Subclass of`.TimerBase` that uses WxTimer events.

Attributes
----------
Expand All@@ -114,8 +114,7 @@ class TimerWx(TimerBase):
Stores list of (func, args) tuples that will be called upon timer
events. This list can be manipulated directly, or the functions
`add_callback` and `remove_callback` can be used.

'''
"""

def __init__(self, *args, **kwargs):
if args and isinstance(args[0], wx.EvtHandler):
Expand Down
5 changes: 1 addition & 4 deletionslib/matplotlib/backends/backend_wxagg.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -33,10 +33,7 @@ def draw(self, drawDC=None):
self.gui_repaint(drawDC=drawDC, origin='WXAgg')

def blit(self, bbox=None):
"""
Transfer the region of the agg buffer defined by bbox to the display.
If bbox is None, the entire buffer is transferred.
"""
# docstring inherited
if bbox is None:
self.bitmap = _convert_agg_to_wx_bitmap(self.get_renderer(), None)
self.gui_repaint()
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp