Showing Surface Plot With Contours
In plotly, contours attribute is used to Display and customize contour data for each axis.
Example:
Python3
import plotly.graph_objects as go import numpy as np x = np.outer(np.linspace( - 2 , 2 , 30 ), np.ones( 30 )) # transpose y = x.copy().T z = np.cos(x * * 2 + y * * 2 ) fig = go.Figure(data = [go.Surface(x = x, y = y, z = z)]) fig.update_traces(contours_z = dict ( show = True , usecolormap = True , highlightcolor = "limegreen" , project_z = True )) fig.show() |
Output:
3D Surface Plots using Plotly in Python
Plotly is a Python library that is used to design graphs, especially interactive graphs. It can plot various graphs and charts like histogram, barplot, boxplot, spreadplot, and many more. It is mainly used in data analysis as well as financial analysis. plotly is an interactive visualization library.