tepkit.utils.mpl_tools.Figure#
- class tepkit.utils.mpl_tools.Figure(width: float = 1.0, height: float = 0.9, dpi: float = None, font_size=None, style='tepkit_basic', projection=None)#
Attributes#
Attribute |
Default Value |
Description |
---|---|---|
|
|
The ratio to the recommended width (3.334 inch = 1000 px at 300 dpi ≈ 8.47 cm),
default set to 1.0.
|
|
|
The ratio to the recommended height (3.334 inch = 1000 px at 300 dpi ≈ 8.47 cm),
default set to 0.9.
|
|
|
|
|
|
|
|
|
The latest legend added by |
|
|
The latest colorbar added by |
Methods#
|
A wrapper of |
|
A wrapper of |
|
A wrapper of |
|
A wrapper of |
|
A wrapper of |
|
A wrapper of |
|
A wrapper of |
All Members#
- width: int | float
- The ratio to the recommended width (3.334 inch = 1000 px at 300 dpi ≈ 8.47 cm),default set to 1.0.
- height: int | float
- The ratio to the recommended height (3.334 inch = 1000 px at 300 dpi ≈ 8.47 cm),default set to 0.9.
- fig
- ax
- legend = None
The latest legend added by
.add_legend()
.
- colorbar = None
The latest colorbar added by
.add_colorbar()
.
- add_legend(*args, border_width: int | float | None = None, **kwargs)
A wrapper of
matplotlib.pyplot.legend()
.- Returns:
matplotlib.legend.Legend
Features#
- Add parameter aliases:
font_size
:fontsize
- Add automatic behaviors:
Sync the border width of the legend to the left axis.
- Add new parameters:
border_width
: Set the border width of the legend.
- add_colorbar(*args, width: int | float = 1, height: int | float = 1, border_width: int | float | None = None, **kwargs)
A wrapper of
matplotlib.pyplot.colorbar()
.- Returns:
matplotlib.colorbar.Colorbar
Features#
- Add automatic behaviors:
Sync the border width of the colorbar to the left axis.
- Add new parameters:
width
andheight
: Change the size of the colorbar.border_width
: Set the border width of the colorbar.
- static adjust_margin(*, top=None, right=None, bottom=None, left=None, wspace=None, hspace=None) None
A wrapper of
matplotlib.pyplot.subplots_adjust()
.Adjust the margin of the figure in pixels.
- set_locator(*args, **kwargs)
A wrapper of
tepkit.utils.mpl_tools.ticker_tools.set_axes_ticker_locator()
.Set
ax
asself.ax
.
- set_formatter(*args, **kwargs)
A wrapper of
tepkit.utils.mpl_tools.ticker_tools.set_axes_ticker_formatter()
.Set
ax
asself.ax
.
- save(path='tepkit.figure.png', **kwargs) None
A wrapper of
matplotlib.figure.Figure.savefig()
.Features#
- Add parameter aliases:
path
:fname
- Add parameter default value:
path
:tepkit.figure.png
- show(dpi=200)
A wrapper of
matplotlib.pyplot.show()
.Features#
- Add new parameters:
dpi
: Change the dpi of the figure before show it to avoid covering too much of the screen.