graphinglib.Heatmap.from_points#
- classmethod Heatmap.from_points(points: ArrayLike, values: ArrayLike, x_axis_range: tuple[float, float], y_axis_range: tuple[float, float], grid_interpolation: str = 'nearest', fill_value: float = nan, color_map: str | Colormap | Inherit = Inherit, color_map_range: tuple[float, float] | None = None, show_color_bar: bool = True, alpha: float = 1.0, aspect_ratio: str | float | Inherit = Inherit, origin_position: str | Inherit = Inherit, interpolation: str = 'none', number_of_points: tuple[int, int] = (50, 50), norm: str | Normalize | None = None) Self[source]#
Creates a heatmap by interpolating unevenly distributed data points on a grid.
- Parameters:
- pointsArrayLike
The list or array of points at which values are known.
- valuesArrayLike
The list or array of values at given points.
- 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.
- grid_interpolationstr
Interpolation method to be used when interpolating the uneavenly distributed data on a grid. Values are
"nearest","linear", and"cubic".- 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 thefigure_styleconfiguration.- 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 is0(transparent) to1(opaque). Defaults to 1.0.- aspect_ratiostr or float
Aspect ratio of the axes. Values include
"auto","equal", or a positive float. Default depends on thefigure_styleconfiguration.- origin_positionstr
Position of the origin of the axes (upper left or lower left corner). Values are
"upper"and"lower". Default depends on thefigure_styleconfiguration.- interpolationstr
Interpolation method to be applied to the image. 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.
- number_of_pointstuple[int, int]
Number of points in the x and y coordinates. Defaults to
(50, 50).- normstr or Normalize, optional
Normalization of the colormap. Default is
None.
- Returns:
- A
Heatmapobject created from data points.
- A