I have a plot look like this:

Obviously, the left and right side is a waste of space, so I set
plt.axis('tight')
But this gives me plot like this:

The xlim looks right now, but the ylim is too tight for the plot.
I'm wondering, if I can only set axis(tight) only to x axis in my case?
So the plot may look something like this:

It's certainly possible that I can do this manually by
plt.gca().set_xlim(left=-10, right=360)
But I'm afraid this is not a very elegant solution.



所有评论(0)