Matplotlib - Stepped histogram with already binned data
matplotlib, numpy, python, scipy
Solution
You could cheat, by offsetting your data and using `plot` instead:
from matplotlib import pyplot
import numpy as np
#sample data:
x = np.arange(30)
y = np.cumsum(np.arange(30))
#offset the x for horizontal, repeat the y for vertical:
x = np.ravel(zip(x,x+1))
y = np.ravel(zip(y,y))
pyplot.plot(x,y)
pyplot.savefig('plt.png')
the plot:
Problem
I am trying to get a histogram with already binned data. I have been trying to use `bar()` for this, but I can't seem to figure out how to make it a stepped histogram like this one from the examples, instead of a filled histogram.