plot_heatmap

Contents

plot_heatmap#

MDDC.utils.plot_heatmap(data, size_cell=0.2, **kwargs)#

Plot a heatmap of the specified attribute from the mddc_result.

This function generates a heatmap for a given attribute of mddc_result, which should be a named tuple with fields that include the attribute specified by the plot parameter. The heatmap is visualized using a color mesh plot, with optional customization through additional keyword arguments.

Parameters:#

datanumpy.ndarray, pandas.DataFrame

Data which should be plotted as a heatmap.

size_cellfloat, optional, default=0.20

The size of each cell in the heatmap, which affects the dimensions of the resulting plot.

**kwargs

Additional keyword arguments to be passed to ax.pcolormesh() for customizing the heatmap appearance.

Returns#

matplotlib.figure.Figure

The generated heatmap figure.

Raises:#

ValueError

If the specified plot attribute is not found in mddc_result.

Notes:#

  • The function automatically adjusts the figure size based on the dimensions of the heatmap data and the specified size_cell.

  • The x and y axis labels are set according to the columns and index of the heatmap data.

  • The x-axis tick labels are rotated 90 degrees for better readability.