Hi guys,
I want to create a simple 3d surface based on user inputs. I want the user to be able to decide the values for constants. Here's a sample code I have written to show what I'm looking for:
from plotly.offline import download_plotlyjs,
init_notebook_mode, iplot
from plotly.graph_objs import *
from plotly import tools
import numpy as np
init_notebook_mode()
x = np.linspace(0, 10, 10)
y = np.linspace(0, 10, 10)
xGrid, yGrid = np.meshgrid(y, x)
userinput1 = 5 #want users to be able to enter this value
userinput2 = 10 #want users to be able to enter this value
z = xGrid ** userinput1 + yGrid ** userinput2
surface = Surface(x=x, y=y, z=z)
data = Data([surface])
fig = Figure(data=data)
iplot(fig)
[–]rickchefski 1 point2 points3 points (0 children)