pyrfu.plot.annotate_heatmap module#

pyrfu.plot.annotate_heatmap.annotate_heatmap(im, data: ndarray | List[List[float]] | None = None, valfmt: str = '{x:.2f}', textcolors: tuple = ('black', 'white'), threshold: float | None = None, **textkw)[source]#

Annotate a heatmap.

Parameters:
  • im (matplotlib.image.AxesImage) – The AxesImage to be labeled.

  • data (array_like, Optional) – Data used to annotate. If None, the image’s data is used.

  • valfmt (str or matplotlib.ticker.Formatter, Optional) – The format of the annotations inside the heatmap..

  • textcolors (dict, Optional) – A pair of colors. The first is used for values below a threshold, the second for those above.

  • threshold (float, Optional) – Value in data units according to which the colors from textcolors are applied. If None (the default) uses the middle of the colormap as separation.

  • **textkw – All other arguments are forwarded to each call to text used to create the text labels.

Returns:

texts – Cells labels

Return type:

list