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,553
  • 7
  • 21
  • 36
Atle Kristiansen
  • 707
  • 7
  • 28

0 Answers0