plot_heatmap

gtda.plotting.plot_heatmap(data, x=None, y=None, colorscale='greys', origin='upper', title=None, plotly_params=None)[source]

Plot a 2D single-channel image, as a heat map from 2D array data.

Parameters
  • data (ndarray of shape (n_pixels_x, n_pixels_y)) – Data describing the heat map value-to-color mapping.

  • x (ndarray of shape (n_pixels_x,) or None, optional, default: None) – Horizontal coordinates of the pixels in data.

  • y (ndarray of shape (n_pixels_y,) or None, optional, default: None) – Vertical coordinates of the pixels in data.

  • colorscale (str, optional, default: "greys") – Color scale to be used in the heat map. Can be anything allowed by plotly.graph_objects.Heatmap.

  • origin ("upper" | "lower", optional, default: "upper") – Position of the [0, 0] pixel of data, in the upper left or lower left corner. The convention "upper" is typically used for matrices and images.

  • title (str or None, optional, default: None) – Title of the resulting figure.

  • plotly_params (dict or None, optional, default: None) – Custom parameters to configure the plotly figure. Allowed keys are "trace" and "layout", and the corresponding values should be dictionaries containing keyword arguments as would be fed to the update_traces and update_layout methods of plotly.graph_objects.Figure.

Returns

fig – Figure representing the 2D single-channel image.

Return type

plotly.graph_objects.Figure object