In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces "how to draw the subplot function in python". In the daily operation, I believe that many people have doubts about how to draw the subplot function in python. The editor consulted all kinds of materials and sorted out a simple and easy-to-use method of operation. I hope it will be helpful to answer the doubt of "how to draw the subplot function in python". Next, please follow the editor to study!
Description
1. Call the subplot () function to create a subgraph, and the program can draw on the subgraph. The nrows parameter of the subplot (nrows, ncols, index, * * kwargs) function specifies how many rows the data map area is divided into, the ncols parameter specifies how many columns the data map area is divided into, and the index parameter specifies how many regions to get.
2. The subplot () function also supports the direct input of a three-digit parameter, where the first digit is the nrows parameter, the second digit is the ncols parameter, and the third digit is the index parameter.
Parameters.
Nrows: number of rows of subplot
Ncols: number of columns of subplot
Sharex: all subplot should use the same X-axis scale (adjusting xlim will affect all subplot)
Sharey: all subplot should use the same Y-axis scale (adjusting ylim will affect all subplot)
Subplot_kw: a keyword dictionary used to create each subplot
* * fig_kw: other keywords when creating figure
Example
Import numpy as npimport matplotlib.pyplot as pltx = np.arange (0100) # drawing 1plt.subplot (2je 2je 1) # equivalent to plt.subplot (221) plt.plot (x, x) # drawing 2plt.subplot (2jue 2) plt.plot (x,-x) # drawing 3plt.subplot (2m 2J 3) plt.plot (x, x * * 2) plt.grid (color='r', linestyle='--', linewidth=1,alpha=0.3) # drawing 4#plt.subplot (224) # plt.plot (x Np.log (x)) plt.show () so far The study on "how to draw the subplot function in python" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
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.