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

Wed, 12/08/2021 - 18:00

Authored by

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