graphinglib.Heatmap.__init__#

Heatmap.__init__(image: TypeAliasForwardRef('ArrayLike') | str, x_axis_range: tuple[float, float] | None = None, y_axis_range: tuple[float, float] | None = None, x_mesh: TypeAliasForwardRef('ArrayLike') | None = None, y_mesh: TypeAliasForwardRef('ArrayLike') | None = None, color_map: str | Colormap | Inherit = Inherit, color_map_range: tuple[float, float] | None = None, show_color_bar: bool | Inherit = Inherit, alpha: float = 1.0, aspect_ratio: str | float | Inherit = Inherit, origin_position: str | Inherit = Inherit, interpolation: str = 'none', norm: str | Normalize | None = None) None[source]#

The class implements heatmaps.

Parameters:
imageArrayLike | str

Image to display. If an array of values is given, the 2D array will be interpreted as the values of the image. If a str if given, the corresponding file will be read as an image.

x_axis_range, y_axis_rangetuple[float, float], optional

The range of x and y values used for the axes as tuples containing the start and end of the range. These values are ignored when x_mesh and y_mesh are provided.

x_mesh, y_meshArrayLike, optional

Mesh grids defining the coordinates of the heatmap values. When provided, the heatmap is plotted using pcolormesh instead of imshow.

color_mapstr, Colormap

The color map to use for the Heatmap. Can either be specified as a string (named colormap from Matplotlib) or a Colormap object. Examples include "viridis", "plasma", and "coolwarm". Default depends on the figure_style configuration.

color_map_range: tuple[float, float], optional

The data range covered by the color map, given as (minimum, maximum).

show_color_barbool

Whether or not to display the color bar next to the plot. Defaults to True.

alphafloat

Opacity value of the Heatmap. Range is 0 (transparent) to 1 (opaque). Defaults to 1.0.

aspect_ratiostr or float

Aspect ratio of the axes. This value is ignored when x_mesh and y_mesh are provided. Values include "auto", "equal", or a positive float. Default depends on the figure_style configuration.

origin_positionstr

Position of the origin of the axes (upper left or lower left corner). This value is ignored when x_mesh and y_mesh are provided. Values are "upper" and "lower". Default depends on the figure_style configuration.

interpolationstr

Interpolation method to be applied to the image. This value is ignored when x_mesh and y_mesh are provided. Values include "none", "nearest", "bilinear", "bicubic", "spline16", "spline36", "hanning", "hamming", "hermite", "kaiser", "quadric", "catrom", "gaussian", "bessel", "mitchell", "sinc", and "lanczos". Defaults to "none".

See also

For other interpolation methods, refer to Interpolations for imshow.

normstr or Normalize, optional

Normalization of the colormap. Default is None.