Home > Software engineering >  Trouble plotting data, the y-axis values are cramped for some reason
Trouble plotting data, the y-axis values are cramped for some reason

Time:06-23

I encountered a problem plotting data as a color bar map using matplotlib and numpy.

I have a data array "b" with the shape (48, 21600) that I'm trying to plot as a color map, when I do that I run into the issue of cramped numbers on the y-axis and no useful visualization.

fig, ax = plt.subplots(1, dpi=200)
img = ax.imshow(b)
plt.grid(False)
cbar = plt.colorbar(img)
cbar.set_label('Heat')

enter image description here

I hope it helps.

  • Related