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 2D 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 3D 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/cgibin/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 2D only; there
was a 3D module in earlier versions, but it was unmaintained and has
been dropped; (2) 2D 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
