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.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…