In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-17 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.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
Version-- cxf-2.5.2 xml version= "1.0" encoding= "UTF-8"? >
Wechat
About us
Contact us
Product review
car news
thenatureplanet
More Form oMedia:
AutoTimes.
Bestcoffee.
SL News.
Jarebook.
Coffee Hunters.
Sundaily.
Modezone.
NNB.
Coffee.
Game News.
FrontStreet.
GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.