Skip to content
Advertisement

matplotlib: reduce empty space on axis

The following code (obtained from here):

JavaScript

Gives me this:

output

What I’m trying to do is reduce the empty space on the y-axis, indicated here by the red bars:

enter image description here

How can I do this? Changing the height of the figure doesn’t seem to help.

Advertisement

Answer

One quick solution is to manually set the margins using

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement