Waterfall Plot?

I'm new to matplotlib and was hoping someone could point me in the right direction for making a waterfall plot, similar to MATLAB's 'waterfall'.

I'd like to plot a series of 2-D spectra staggered by time.

Thanks,

Travis

The specgram function is the closest equivalent:

http://matplotlib.sourceforge.net/matplotlib.pyplot.html#-specgram

ยทยทยท

On Tue, Jul 29, 2008 at 1:48 PM, Travis Ruthenburg <truth@...1707...> wrote:

I'm new to matplotlib and was hoping someone could point me in the
right direction for making a waterfall plot, similar to MATLAB's
'waterfall'.

I'd like to plot a series of 2-D spectra staggered by time.

Travis Ruthenburg wrote:

I'm new to matplotlib and was hoping someone could point me in the right direction for making a waterfall plot, similar to MATLAB's 'waterfall'.

I'd like to plot a series of 2-D spectra staggered by time.

Travis,

I presume you are handling the calculation of spectra, and the question is really about plotting offset lines.

We do not have the 3-D type plot illustrated here:
http://www.mathworks.com/access/helpdesk/help/techdoc/index.html?/access/helpdesk/help/techdoc/ref/waterfall.html&http://www.mathworks.com/cgi-bin/texis/webinator/search/

but there are a couple of ways you can plot offset lines. One is to use the plot command to plot a set of lines, to which you have added the offsets yourself. The other is to make a LineCollection. I see that our example of the latter does not actually make use of the feature that automatically applies the constant offsets, so I need to make a revised example, which I can't do right this minute. In the meantime, the approach in line_collection.py and line_collection2.py in the mpl examples directory (examples/pylab_examples/ in the 0.98.x and svn versions) will work.

Backing off slightly, the larger points are (1) mpl is 2-D only; there was a 3-D module in earlier versions, but it was unmaintained and has been dropped; (2) 2-D plotting is very flexible; (3) often the problem is not one of plotting but of manipulating your input arrays, so the better you know numpy, the easier and more efficiently you can generate plots.

Eric