2

I'm trying to remove the white spaces padding matplotlib's generated spectrogram. I've tried setting a limit to the axis and setting tight to the axis but these don't work.

Here's a screenshot: Screenshot with padding

Thanks

1

1 Answer 1

0

You can use plt.xlim() and plt.ylim() with the desired limits.

Your plt.axis(...) should have done, try to run it after the plot.

Similar question, and another.

Sign up to request clarification or add additional context in comments.

3 Comments

I tried with those functions but they don't work. I'm using Jupyter so I thought it was a problem with
... "%matplotlib notebook", so I changed that to "%matplotlib inline" like how they show up in examples but that doesn't work either.
Have you tried to use those commands after the plt.specgram? Or use the set_autoscale_on(False) on your axis before drawing?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.