title: Get step function values from matplotlib
body: <p>I have 2 numpy arrays with data, say <code>x,y</code>, and I apply <code>plt.step()</code> and get a continues (step) curve of it.</p>
  <p>I would like to be able to create this function by my own, meaning I want to have an (zero order hold) step approximation to the value of <code>y</code> for <code>x</code> that does not actually exist in the original <code>x</code> array.</p>
  <p>For example, in the following link I want to have the 'new' actual rectangle sine values, and not only plotted:
  <a href="https://matplotlib.org/gallery/lines_bars_and_markers/step_demo.html#sphx-glr-gallery-lines-bars-and-markers-step-demo-py" rel="nofollow noreferrer">https://matplotlib.org/gallery/lines_bars_and_markers/step_demo.html#sphx-glr-gallery-lines-bars-and-markers-step-demo-py</a></p>