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

Commit99eb7a4

Browse files
committed
Cleanup docstring of print_figure, savefig.
Correct doc for filename. Move doc for orientation down to its positionin the signature. Make typespec for bbox_inches fit in one line (Ithink the line continuation is ugly enough to prefer not using a fullyqualified name for .Bbox).
1 parentcc55b47 commit99eb7a4

File tree

2 files changed

+11
-14
lines changed

2 files changed

+11
-14
lines changed

‎lib/matplotlib/backend_bases.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1974,11 +1974,8 @@ def print_figure(self, filename, dpi=None, facecolor=None, edgecolor=None,
19741974
19751975
Parameters
19761976
----------
1977-
filename
1978-
can also be a file object on image backends
1979-
1980-
orientation : {'landscape', 'portrait'}, default: 'portrait'
1981-
only currently applies to PostScript printing.
1977+
filename : str or path-like or file-like
1978+
The file where the figure is saved.
19821979
19831980
dpi : float, default: :rc:`savefig.dpi`
19841981
The dots per inch to save the figure in.
@@ -1989,16 +1986,17 @@ def print_figure(self, filename, dpi=None, facecolor=None, edgecolor=None,
19891986
edgecolor : color, default: :rc:`savefig.edgecolor`
19901987
The edgecolor of the figure.
19911988
1989+
orientation : {'landscape', 'portrait'}, default: 'portrait'
1990+
Only currently applies to PostScript printing.
1991+
19921992
format : str, optional
19931993
Force a specific file format. If not given, the format is inferred
19941994
from the *filename* extension, and if that fails from
19951995
:rc:`savefig.format`.
19961996
1997-
bbox_inches : 'tight' or `~matplotlib.transforms.Bbox`,\
1998-
default: :rc:`savefig.bbox`
1999-
Bbox in inches. Only the given portion of the figure is
2000-
saved. If 'tight', try to figure out the tight bbox of
2001-
the figure.
1997+
bbox_inches : 'tight' or `.Bbox`, default: :rc:`savefig.bbox`
1998+
Bounding box in inches: only the given portion of the figure is
1999+
saved. If 'tight', try to figure out the tight bbox of the figure.
20022000
20032001
pad_inches : float, default: :rc:`savefig.pad_inches`
20042002
Amount of padding around the figure when *bbox_inches* is 'tight'.

‎lib/matplotlib/figure.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2112,10 +2112,9 @@ def savefig(self, fname, *, transparent=None, **kwargs):
21122112
transparency of these patches will be restored to their
21132113
original values upon exit of this function.
21142114
2115-
bbox_inches : str or `~matplotlib.transforms.Bbox`, optional
2116-
Bbox in inches. Only the given portion of the figure is
2117-
saved. If 'tight', try to figure out the tight bbox of
2118-
the figure. If None, use savefig.bbox
2115+
bbox_inches : str or `.Bbox`, default: :rc:`savefig.bbox`
2116+
Bounding box in inches: only the given portion of the figure is
2117+
saved. If 'tight', try to figure out the tight bbox of the figure.
21192118
21202119
pad_inches : scalar, optional
21212120
Amount of padding around the figure when bbox_inches is

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp