Introduction to matplotlib and simple use of pyplot -- artists

Source: Internet
Author: User

This article introduces the graph structure and various artists in matplotlib.

I used to know how to use pyplot to draw a graph. I didn't understand pyplot. Now I want to understand it.

In pyplot (or a more comprehensive matplotlib), there are two types of artists. One is primitives, an element that indicates the standard image object we want to draw, like line2d (2D curves), rectangle, text, axesimage, etc. The other is containers, which is used to store elements such as axis, axes, and figure.

Each artist has many attributes that can be set, as shown in,

Here there are content related to boudningbox, which may be used later.

Since each artist has these attributes, you can set them. The container can be set directly. What about primitives? Since the container contains primitives, you can get the primitives from the container and set them. The following describes the container.

The top layer is figure, which contains all the content in the drawn image. The content is

Then there is the most important axes, because it is the drawing area in most cases, through the plot (), text (), hist (), imshow () and so on, to create image elements, the previously used subplot is a special type of axes.

The primitives added in axes are implemented by the following method,

Like figure, axes acts as containers and includes the following attributes,

The axis is located at the bottom of the axes. You can set the attributes of the axis,
There is also the last layer under Axis. Tick is the scale, annotation, and so on above the axis. Therefore, it is related to the image to have two coordinate axes, or to switch the coordinate axes from the left to the right.

This part is actually the ninth chapter of the matplotlib manual. For more information, see the manual.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.