Heatmap

class gdt.core.plot.plot.Heatmap(x, y, heatmap, ax, colorbar=True, color=<GdtCmap: viridis;           alpha_min=0.00;           alpha_max=1.00;           alpha_scale=linear>, alpha=None, norm=None, num_contours=100, **kwargs)[source]

Bases: PlotElement

Plot a general heatmap (color gradient). By default, the heatmap opacity will scale from 0 (fully transparent) to 1 (fully opaque) corresponding to the colormap value, creating an opacity gradient. This behavior can be adjusted by setting alpha_min and alpha_max.

Parameters:
  • x (np.array) – The x-coordinate array of the heatmap grid

  • y (np.array) – The y-coordinate array of the heatmap grid

  • heatmap (np.array) – The heatmap array, of shape (x.size, y.size)

  • ax (matplotlib.axes) – The axis on which to plot

  • colorbar (bool, optional) – If True, add the colorbar scale. Default is True.

  • color (GdtCmap) – The colormap of the heatmap. Default is ‘viridis’

  • norm (matplotlib.colors.Normalize or similar, optional) – The normalization used to scale the colormapping to the heatmap values. This can be initialized by the defined matplotlib normalizations or a custom normalization.

  • num_contours (int, optional) – The number of contour lines to draw. Default is 100.

  • **kwargs – Other plotting options

Attributes Summary

alpha

The alpha opacity value, between 0 and 1.

artists

The object references to the individual matplotlib elements

color

The colormap

colorbar

The colorbar object

norm

The colormap normalization

num_contours

Number of plot contours

visible

True if the element is shown on the plot, False otherwise

zorder

The plot element zorder

Methods Summary

hide()

Hide the plot element

remove()

Remove the plot element

show()

Show the plot element

toggle()

Toggle the visibility of the plot element

Attributes Documentation

alpha

The alpha opacity value, between 0 and 1.

Type:

(float)

artists

The object references to the individual matplotlib elements

Type:

(list)

color

The colormap

Type:

(GdtCmap)

colorbar

The colorbar object

Type:

(matplotlib.colorbar.Colorbar)

norm

The colormap normalization

Type:

(matplotlib.colors.Normalize or similar)

num_contours

Number of plot contours

Type:

(int)

visible

True if the element is shown on the plot, False otherwise

Type:

(bool)

zorder

The plot element zorder

Type:

(int)

Methods Documentation

hide()

Hide the plot element

remove()

Remove the plot element

show()

Show the plot element

toggle()

Toggle the visibility of the plot element