In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article is about how to implement 3D diagrams in Matplotlib. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
Background introduction
Demonstrates drawing a 3D map of a surface defined in polar coordinates. And use the built-in color map in matplotlib to show.
Getting started example code block''= 3D surfaces and polar coordinates = = demonstrates drawing surfaces defined in polar coordinates. Use YlGnBu color map to reverse the version.''# Import Axes3D Registration 3D projection from mpl_toolkits.mplot3d import Axes3Dimport matplotlib.pyplot as pltimport numpy as np# definition subchart Add 3D projection fig = plt.figure () ax = fig.add_subplot (111111projection='3d') # create the grid in polar coordinates and calculate the corresponding Z value. R = np.linspace (0,1.25,50) p = np.linspace (0, 2*np.pi, 50) R, P = np.meshgrid (r, p) Z = ((Renewal 2-1) * * 2) # represents the grid X, Y = R*np.cos (P) in the Cartesian system R*np.sin (P) # draw the surface .ax.plot _ surface (X, Y, Z,\ cmap=plt.cm.YlGnBu_r) # adjust the limit and add the numeric label ax.set_zlim (0 1) ax.set_xlabel (ringing $\ phi_\ mathrm {real} $') ax.set_ylabel (rattling $\ phi_\ mathrm {im} $') ax.set_zlabel (ringing phi V (\ phi) $') # form display plt.show () Thank you for reading! This is the end of the article on "how to realize 3D Chart in Matplotlib". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.