I am trying to make an interactive notebook (with voila
) where I use ipyvolume
for plotting a surface. However, I do not manage to set the camera correctly with ipyvolume
. It should be a top-down view onto the z-direction. It works fine in the matplotlib
case, but setting the same angle in ipyvolume
does give me some 45º view. How can I get it to show the top down view?
If there is another way to achieve that, that's also be ok (needs to work in voila
and be able to dynamically update the X, Y, Z and color data).
make data
import pandas as pd
import numpy as np
import ipyvolume as ipv
g = np.linspace(-np.pi/2, np.pi/2, 10)
X, Y = np.meshgrid(g, g, indexing='ij')
Z = np.sin(X**2+Y**2)
the ipyvolume
plot
fig1 = ipv.figure()
mesh = ipv.plot_surface(X, Z, Y)
ipv.show()
ipv.pylab.view(90,-90)
the matpotib pot
fig = plt.figure(figsize=(5,5))
ax = fig.add_subplot(projection='3d')
ax.view_init(90, -90)
ax.set_xlabel('x')
ax.set_ylabel('y')
surf = ax.plot_surface(X, Y, Z)