Movatterモバイル変換


[0]ホーム

URL:


Open In App
Next Article:
3D Contour Plotting in Python using Matplotlib
Next article icon

To create static, animated and interactive visualizations of data, we use the Matplotlib module in Python. The below programs will depict 3D wireframe. visualization of data in Python. In-order to visualize data using 3D wireframe we require some modules from matplotlib, mpl_toolkits and numpy library. 
Example 1: 
 

Python3
# importing modulesfrommpl_toolkits.mplot3dimportaxes3dfrommatplotlibimportpyplot# creating the visualizationfig=pyplot.figure()wf=fig.add_subplot(111,projection='3d')x,y,z=axes3d.get_test_data(0.05)wf.plot_wireframe(x,y,z,rstride=2,cstride=2,color='green')# displaying the visualizationwf.set_title('Example 1')pyplot.show()

Output: 
 


In the above program, a 3D wireframe is plotted using test values for coordinates.
Example 2: 
 

Python3
# importing modulesfrommpl_toolkitsimportmplot3dimportnumpyfrommatplotlibimportpyplot# assigning coordinatesa=numpy.linspace(-5,5,25)b=numpy.linspace(-5,5,25)x,y=numpy.meshgrid(a,b)z=numpy.sin(numpy.sqrt(x**2+y**2))# creating the visualizationfig=pyplot.figure()wf=pyplot.axes(projection='3d')wf.plot_wireframe(x,y,z,color='green')# displaying the visualizationwf.set_title('Example 2')pyplot.show()

Output: 
 


 


Improve
Practice Tags :

Similar Reads

We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood ourCookie Policy &Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences

[8]ページ先頭

©2009-2025 Movatter.jp