Axes.heatmap(*args, aspect=None, **kwargs)[source]

Pass all arguments to pcolormesh then apply settings that are suitable for heatmaps: square grid boxes by default, major ticks at the center of each grid box, no minor ticks, and no gridlines.


aspect ({‘equal’, ‘auto’} or float, optional) – Controls the aspect ratio of the axes. The aspect is of particular relevance for heatmaps since it may distort the heatmap, i.e. a grid box will not be square. This parameter is a shortcut for explicitly calling set_aspect.

The default is rc[‘image.heatmap’]. The options are:

  • 'equal': Ensures an aspect ratio of 1. Grid boxes will be square.

  • 'auto': The axes is kept fixed and the aspect is adjusted so that the data fit in the axes. In general, this will result in non-square grid boxes.