domplotlib
¶
Dom’s extensions to matplotlib.
Functions:
|
Creates a figure with the given margins, and returns a tuple of the figure and its axes. |
|
Place a legend on the figure, with the items arranged to read right to left rather than top to bottom. |
|
Save the given figure as an SVG. |
|
Transposes the contents of |
-
create_figure
(pagesize, left=0.2, bottom=0.14, right=0.025, top=0.13)[source]¶ Creates a figure with the given margins, and returns a tuple of the figure and its axes.
-
horizontal_legend
(fig, handles=None, labels=None, *, ncol=1, **kwargs)[source]¶ Place a legend on the figure, with the items arranged to read right to left rather than top to bottom.
- Parameters
- Return type
-
save_svg
(figure, fname, *, dpi=None, facecolor='w', edgecolor='w', orientation='portrait', transparent=False, bbox_inches=None, pad_inches=0.1, **kwargs)[source]¶ Save the given figure as an SVG.
- Parameters
figure (
Figure
)fname (
Union
[str
,Path
,PathLike
,IO
]) –The file to save the SVG as. If
format
is set, it determines the output format, and the file is saved asfname
. Note thatfname
is used verbatim, and there is no attempt to make the extension, if any, offname
matchformat
, and no extension is appended.If
format
is not set, then the format is inferred from the extension offname
, if there is one.dpi (
Union
[float
,Literal
['figure'
],None
]) – The resolution in dots per inch. If'figure'
, use the figure’s dpi value. DefaultNone
.facecolor (
Union
[str
,Literal
['auto'
]]) – The facecolor of the figure. If'auto'
, use the current figure facecolor. Default'w'
.edgecolor (
Union
[str
,Literal
['auto'
]]) – The edgecolor of the figure. If'auto'
, use the current figure edgecolor. Default'w'
.orientation (
Literal
['portrait'
,'landscape'
]) – Currently only supported by the postscript backend. Default'portrait'
.transparent (
bool
) – IfTrue
, the axes patches will all be transparent; the figure patch will also be transparent unlessfacecolor
and/oredgecolor
are specified. This is useful, for example, for displaying a plot on top of a colored background on a web page. The transparency of these patches will be restored to their original values upon exit of this function. DefaultFalse
.bbox_inches (
Optional
[str
]) – Bounding box in inches: only the given portion of the figure is saved. If ‘tight’, try to figure out the tight bbox of the figure. DefaultNone
.pad_inches (
float
) – Amount of padding around the figure when bbox_inches is ‘tight’. Default0.1
.**kwargs – Additional keyword arguments passed to
savefig()
.