Waterfall plot python?


Question

Is there a python module that will do a waterfall plot like MATLAB does? I googled 'numpy waterfall', 'scipy waterfall', and 'matplotlib waterfall', but did not find anything.

1
16
1/29/2016 11:06:09 AM

Accepted Answer

Have a look at mplot3d:

# copied from 
# http://matplotlib.sourceforge.net/mpl_examples/mplot3d/wire3d_demo.py

from mpl_toolkits.mplot3d import axes3d
import matplotlib.pyplot as plt
import numpy as np

fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
X, Y, Z = axes3d.get_test_data(0.05)
ax.plot_wireframe(X, Y, Z, rstride=10, cstride=10)

plt.show()

http://matplotlib.sourceforge.net/mpl_toolkits/mplot3d/tutorial.html#wireframe-plots

I don't know how to get results as nice as Matlab does.


If you want more, you may also have a look at MayaVi: http://mayavi.sourceforge.net/

6
6/26/2012 2:45:45 PM

You can do a waterfall in matplotlib using the PolyCollection class. See this specific example to have more details on how to do a waterfall using this class.

Also, you might find this blog post useful, since the author shows that you might obtain some 'visual bug' in some specific situation (depending on the view angle chosen).

Below is an example of a waterfall made with matplotlib (image from the blog post): image
(source: austringer.net)


Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon