A heatmap in Matplotlib is a color-coded image of a two-dimensional array, and Axes.imshow is the quickest way to draw one. The official Matplotlib gallery describes it this way: data that depends on ...
A colorbar is the legend for any figure that encodes numbers as color: an image, a heatmap, a filled contour plot. In Matplotlib, fig.colorbar(im, ax=ax) attaches one to an existing plot, and the ...