Black Lives Matter. Please consider donating to Black Girls Code today.

Plot mesh 3d using color based on a column in dataframe

Hello fellow data scientist and developers, I have a question about 3d mesh plot on Plotly.

In the first example of “https://plotly.com/python/3d-mesh/”, the plot color is specified as color=‘lightpink’. How do I specify the color of a 3d mesh plot based on a column in the database instead of one uniform color?

I would love to be able to specify the color based on a column of the data frame in the same way as presented in “https://plotly.com/python/3d-scatter-plots/” (color=‘petal_length’). What is the best way I can achieve this? Thank you.