Как добиться того, чтобы ось не была зажата на участке? - PullRequest
1 голос
/ 11 июля 2020

Для построения тепловой карты я сделал:

f, ax = plt.subplots(1, 1, dpi=dpi)
im0 = ax.imshow(data, cmap='Wistia')

Из-за размерности данных с (300K, 20) результирующая ось Y была сжата. enter image description here

Maybe squeezing of Y-axis happened because of :

from mpl_toolkits.axes_grid1 import make_axes_locatable

# create an axes on the right side of ax. The width of cax will be 5%
# of ax and the padding between cax and ax will be fixed at 0.05 inch.

divider = make_axes_locatable(ax)
cax = divider.append_axes("right", size="5%", pad=0.05)
plt.colorbar(im0, cax=cax)

How can I get heatmap more look like (with full Y-range [0, 20]):

введите описание изображения здесь

...