Alejandro Weinstein, on 2011-02-09 13:01, wrote:
Any suggestion for making a stair plot in Matplotlib (like the stairs
function in Matlab)?
The attached figure is the output of the following Matlab commands:
x = 0:10;
I guess it is a matter of using a zero-order hold interpolation rather
than linear interpolation between the points in the plot command, but
I haven't find how to do that.
no need for interpolation - just use plt.step:
import numpy as np
import matplotlib.pyplot as plt
x = np.arange(10)
you might also want to play with step's "where" parameter for
slightly different behavior of where the transition between the
314 address only used for lists, off-list direct email at:
http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7