Skip to main content

Matplotlib: 3D Wireframe plot

Wireframe Plot is created by using the plot_wireframe() function. It takes the grid of values and specified them onto the 3-D surface and, it can help in making the resulting three-dimensional forms quite easy for visualization.

Examples

# import modules
from mpl_toolkits import mplot3d
import numpy
import matplotlib.pyplot as plt

a = numpy.linspace(-7, 7, 25)
b = numpy.linspace(-7, 7, 25)
x, y = numpy.meshgrid(a, b)
z = numpy.tan(numpy.sqrt(x**2 + y**2)) 

# create the visualization
fig = pyplot.figure()
wf= pyplot.axes(projection ='3d')
wf.plot_wireframe(x, y, z, color ='blue') 

# displaying the visuliztion
wf.set_title('3-D Wireframe')
pyplot.show()

Output

3-d wireframe

Tags
Submitted by devanshi.srivastava on December 8, 2021

Devanshi, is working as a Data Scientist with iVagus. She has expertise in Python, NumPy, Pandas and other data science technologies.

About

At ProgramsBuzz, you can learn, share and grow with millions of techie around the world from different domain like Data Science, Software Development, QA and Digital Marketing. You can ask doubt and get the answer for your queries from our experts.