Matplotlib and Matplotlib

Source: Internet
Author: User
Tags color representation comparison table

Matplotlib and Matplotlib

Matplotlib may encounter color selection problems. Many people may think that the color of their own matlab style is not good. Fortunately, Matplotlib has foreseen this problem. In addition to supporting the most basic traditional matlab colors, it also supports many color Expressions:

 
 
  • RGB or RGBA floating point value tuples,[0, 1]For example(0.1, 0.2, 0.5)Or(0.1, 0.2, 0.5, 0.3).

  • RGB or RGBA hexadecimal string, such#0F0F0FOr#0F0F0F0F.

  • [0, 1]A string representation of a floating point value, used to represent a gray scale, for example0.5.

  • {'b', 'g', 'r', 'c', 'm', 'y', 'k', 'w'}.

  • The color name of X11/CSS4.

  • One of the XKCD colors,'xkcd:'Is the prefix, for example'xkcd:sky blue'.

  • {'C0', 'C1', 'C2', 'C3', 'C4', 'C5', 'C6', 'C7', 'C8', 'C9'}.

  • {'tab:blue', 'tab:orange', 'tab:green', 'tab:red', 'tab:purple', 'tab:brown', 'tab:pink', 'tab:gray', 'tab:olive', 'tab:cyan'}. This is the Tableau color of the T10 palette (default color)

In this article, the color representation mentioned by the author is relatively simple. It is the X11 color description method mentioned above. All colors and Corresponding English names are listed in the X11 wiki:

In addition, the colors in matplotlib are case sensitive. The uppercase color names provided in wiki are not necessarily used directly, but must be written in lowercase.

 

Another way to use a ready-to-use color is to use the xkcd color mentioned above. You can find the color of the xkcd tag on this website. The source of xkcd color is also amazing. xkcd conducted a survey to investigate the user's names for various colors and finally obtained the xkcd color name. Therefore, the xkcd and X11 colors are many different. The same name may correspond to different colors. Matplotlib provides a comparison table to compare the naming differences between the two systems:

 

Related Article

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.