I am facing a small problem with xlim and xticks and nor google nor the
api helped me (one of the reason being that I likely don't know the
exact term I am looking for).
I am plotting a barplot using pyplot and bar() on matplotlib 0.98.5.2.
If I do not use xticks the x axis goes from 0 to 500 leaving some empty
space at the right of the last bar before the frame.
When I use xticks to name my bar (name being either a string or nothing
I tried both), then the frame come beside the last bar on the right of
Then problem is that I want to keep this space between the last bar and
I looked at
pyplot.xlim(xmax = 500)
but if print pyplot.axis() returns the correct dimension the frame still
persists at this place.
How could I set the width correctly and use xticks ?
I hope I am clear in my explanations.