I have a 2D numpy array and I want to plot it in 3D. I heard about mplot3d but I cant get to work properly
Here\'s an example of what I want to do. I have an array with
You can also use oct2py module which is actually an python-octave bridge. Using it you can exploit fucntions of octave, and you can get the thing you need, and it's pretty easy as well.
check out this documentation : https://www.gnu.org/software/octave/doc/v4.0.1/Three_002dDimensional-Plots.html
And for sample example:
from oct2py import octave as oc
tx = ty = oc.linspace (-8, 8, 41)
[xx, yy] = oc.meshgrid (tx, ty)
r = oc.sqrt (xx * xx + yy * yy) + oc.eps()
tz = oc.sin (r) / r
oc.mesh (tx, ty, tz)
Above is the python code, which is as same as the first example implemented in octave in the above documentation.