table of Contents
1. Principle drawing
2. The drawing area setting
When we need to draw a number of different patterns on a canvas figure, different graphs can be plotted in several different areas among the axes. There are three ways:
- Call auto_subplot () object method by Figure
- By subplot plt () method
- By subplots plt () method
2.1 add_subplot method
- Creating a target figure, if not manually created, automatically created implicitly.
- Figure calling object auto_subplot () method number of rows, designated subregion and subregion to specify the current to be drawn which returns a child drawing object (axis object).
- By graphing child drawing object.
2.2 subplot method
- By calling subplot plt () method to create a sub-region of the drawing, the child returned drawing object.
- Figure implicitly created objects.
2.3 subplots method
- Created by invoking the subplots plt () method of the sub-drawing region, the method returns a tuple (Figure a drawing object and all child objects, if a plurality of drawing objects child, it returns an array ndarray).
- You can set whether or shared x-axis and y-axis by sharex shareyss.
3. scale settings
Or the setting information acquired by the related method plt scale objects.
- plt.xlim Gets or sets the x-axis scale range
- plt.ylim Gets or sets the y-axis scale range
- plt.xticks Gets or sets the x-axis scale shows the numeric / text
- plt.yticks Gets or sets the y-axis scale shows the numeric / text
plt.xlim plt.ylim and get or set the scale range
plt.xticks plt.yticks and get or set the scale information
may be provided through the sub-scale drawing object information.
- The x-axis scale range set ax.set_xlim
- acquiring the x-axis scale range ax.get_xlim
- ax.set_xticks disposed in the x-axis scale
- Get ax.get_xticks scale of the x-axis
- Similarly as the y-axis
Example: