pyrfu.plot.plot_heatmap module#
- pyrfu.plot.plot_heatmap.plot_heatmap(ax: Axes, data: ndarray | List[List[float]], row_labels: ndarray | List[str], col_labels: ndarray | List[str], cbar_kw: dict | None = None, cbarlabel: str = '', **kwargs) Tuple[AxesImage, Colorbar] [source]#
Create a heatmap from a numpy array and two lists of labels.
- Parameters:
ax (matplotlib.axes._axes.Axes) – Axis to which the heatmap is plotted.
data (array_like) – A 2D numpy array of shape (N, M).
row_labels (list or numpy.ndarray) – A list or array of length N with the labels for the rows.
col_labels (list or numpy.ndarray) – A list or array of length M with the labels for the columns.
cbar_kw (dict, Optional) – A dictionary with arguments to matplotlib.Figure.colorbar.
cbarlabel (str, Optional) – The label for the colorbar.
**kwargs – All other arguments are forwarded to imshow.
- Returns:
im (matplotlib.image.AxesImage) – The AxesImage of the data.
cbar (matplotlib.colorbar.Colorbar) – Colorbar.