In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article will explain in detail how to use matplotlib to draw coordinate maps, radar maps and polar maps. The editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.
Polar axis
When you call subplot () to create a subgraph, you can create a polar subgraph by setting projection='polar', and then call plot () to draw in the polar subgraph.
# Polar coordinates s = pd.Series (np.arange (20)) fig = plt.figure (figsize= (8Jing 4)) ax = plt.subplot (111111, projection = 'polar') ax.plot (s, linestyle =' -', marker ='., lw=2) # lw: lineweight
Click to add groups to get Python learning materials for free.
The information is in the group file waiting for you to pick it up.
Radar chart
# Radar chart-line chart / mapping of polar coordinates-plt.plot () plt.figure (figsize= (8je 4)) ax1= plt.subplot (111, projection='polar') ax1.set_title ('spot fish') # create title ax1.set_rlim (0Magol 12) # create data data1 = np.random.randint (1m 10m 10) data2 = np.random.randint (1m 10m 10) data3 = np.random.randint (1m 10m 10) theta=np.arange (0min 2m p. Pi) 2*np.pi/10) # draw radar line ax1.plot (theta,data1,'.--',label='data1') ax1.fill (theta,data1,alpha=0.2) ax1.plot (theta,data2,'.--',label='data2') ax1.fill (theta,data2,alpha=0.2) ax1.plot (theta,data3,'.--',label='data3') ax1.fill (theta,data3,alpha=0.2)
Polar chart-column chart of polar coordinates
# Polar chart-histogram of polar coordinates plt.figure (figsize= (8pr 4)) ax1= plt.subplot (111m, projection='polar') ax1.set_title ('spot fish') # create the title ax1.set_rlim (0jue 12) data = np.random.randint (1m 10pm 10) theta=np.arange (0theta,data,alpha=0.5 2pipp.pipp.pipp10) bar = ax1.bar (theta,data,alpha=0.5) for bar in zip (data) Bar): bar.set_facecolor (plt.cm.jet (rstroke 10.)) # sets the color
This is the end of the article on "how to use matplotlib to draw coordinate maps, radar maps, polar maps". I hope the above content can be helpful to you, so that you can learn more knowledge. if you think the article is good, please share it out 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
# # create a file #! / usr/bin/env python'
© 2024 shulou.com SLNews company. All rights reserved.