mechanochat.plotting.draw_colorbar#
- mechanochat.plotting.draw_colorbar(cmap_name: str = 'Reds', cmap=None, norm: Normalize | None = None, vmax: float = 1., vmin: float = 0., orientation: Literal['horizontal', 'vertical'] = 'horizontal', label: str | None = None, label_size: float = 15., ticks: List | None = None, ticklabels: List | None = None, ticks_size: float = 15., save_name: str | None = None, ax: Axes | None = None)[source]#
Draw a standalone colorbar, e.g. one shared by several panels.
- Parameters:
cmap_name (
str, default'Reds') – Valid matplotlib colormap name. Ignored when cmap is givencmap (
Colormap, optional) – Colormap object, e.g. the one returned by alphashape_plot(return_mappable=True)norm (
Normalize, optional) – Normalization object. Built from vmin / vmax if Nonevmax (
float, default1.) – Bounds used when norm is Nonevmin (
float, default0.) – Bounds used when norm is Noneorientation (
{'horizontal', 'vertical'}, default'horizontal') – Colorbar orientation. Also sets the default figure sizelabel (
str, optional) – Colorbar labellabel_size (
float, default15.) – Label font sizeticks (
list, optional) – Tick positions. Default: matplotlib’s automatic ticksticklabels (
list, optional) – Tick labelsticks_size (
float, default15.) – Tick label font sizesave_name (
str, optional) – Output path for figure saving (e.g., ‘figure.pdf’)ax (
Axes, optional) – Axes used as the colorbar axes. A new figure is created if None
- Returns:
ax (
Axes)