1

I have the following code that creates a spectrogram. The problem I have is when I save the figure, there is white space where the axis used to be, I am wondering if it is possible to remove it?

x, y = np.mgrid[:len(times), :len(hist_bins_khz)]
fig, ax = plt.subplots()
ax.pcolormesh(x, y, np.swapaxes(amplitudes_logged, 0, 1))
plt.axis('off')
plt.savefig("testfile.png"),bbox_inches="tight")

Example output

Artemis
  • 2,389
  • 7
  • 20
  • 34
Atle Kristiansen
  • 707
  • 6
  • 25

0 Answers0