I found an odd behavior for pyplot plots. When the number of data points exceeds a certain amount, the line does not draw to the end -- there's white space on the far right that I cannot get rid of. I'd like to know how I can force pyplot to plot the all the way.
I am using Python 2.7.5 and matplotlib 1.2.1.
from pylab import *
from random import random
bins = arange(0, 180, 5)
data = array([random() for i in xrange(len(bins))])
plot(bins[:10], data[:10], drawstyle="steps-mid") #draws till the end
title("some data")
figure()
plot(bins, data, drawstyle="steps-mid") #white space at the right
title("all data")
show()
This also happens with other active drawstyle options. I could use a xlim to shrink the xaxis after plotting so that the part cut off is cut off the axis as well, but I'd rather not to as I'd like to keep my axis the way it is. I thought about adding an additional element to bins and a zero to data and using xlimafterwards, but this strikes me as a really quirky fix.