autocti.plot.Colorbar#
- class autocti.plot.Colorbar(manual_tick_labels: Optional[List[float]] = None, manual_tick_values: Optional[List[float]] = None, manual_alignment: Optional[str] = None, manual_unit: Optional[str] = None, manual_log10: bool = False, **kwargs)[source]#
Bases:
AbstractMatWrap
Customizes the colorbar of the plotted figure.
This object wraps the following Matplotlib method:
The colorbar object cb that is created is also customized using the following methods:
cb.set_yticklabels: https://matplotlib.org/3.3.2/api/_as_gen/matplotlib.axes.Axes.set_yticklabels.html
- Parameters:
manual_tick_labels – Manually override the colorbar tick labels to an input list of float.
manual_tick_values – If the colorbar tick labels are manually specified the locations on the colorbar they appear running 0 -> 1.
manual_alignment – The vertical alignment of the colorbar tick labels, specified via the matplotlib method set_yticklabels and input va.
manual_unit – The unit label that appears next to the colorbar tick labels, which if not input uses a default unit label specified as cb_unit in the config file `config/visualize/general.yaml.
Methods
Set the figure's colorbar, optionally overriding the tick labels and values with manual inputs.
Set the figure's colorbar using an array of already known color values.
tick_labels_from
tick_values_from
Attributes
cb_unit
config_category
config_dict
config_folder
log10_min_value
- set(units: Units, ax=None, norm=None, cb_unit=None, use_log10: bool = False)[source]#
Set the figure’s colorbar, optionally overriding the tick labels and values with manual inputs.
- set_with_color_values(units: Units, cmap: str, color_values: ndarray, ax=None, norm=None, use_log10: bool = False)[source]#
Set the figure’s colorbar using an array of already known color values.
This method is used for producing the color bar on a Voronoi mesh plot, which is unable to use the in-built Matplotlib colorbar method.
- Parameters:
cmap – The colormap used to map normalized data values to RGBA colors (see https://matplotlib.org/3.3.2/api/cm_api.html).
color_values – The values of the pixels on the Voronoi mesh which are used to create the colorbar.