Python Common Library Three: matplotlib

Source: Internet
Author: User

Import Module
1 Import Matplotlib.pyplot as Plt 2 import Seaborn as SB
Draw a bar chart

Countplot (data: Datasets, x:x axes, color: bar colors, order: Sort)

Color_palette (): Returns an RGB tuple list

Test = Pd.read_csv ('Pokemon.csv')Print(Test.shape)Print(Test.tail (10))#The value_counts function counts the frequency of each sequence and descendingGeneration_order = test['generation_id'].value_counts (). IndexPrint(Generation_order)#Color_palette returns an RGB tuple listBase_color =Sb.color_palette () [0]sb.countplot (Data=test, x='generation_id', Color=base_color, order=generation_order) plt.show ()

xticks (Rotation: Rotation degree): Change the direction of the plotted x-axis labels (number of counter-clockwise grips with horizontal direction)

yticks (Rotation: Rotation degrees): Change the direction of the plotted y-axis labels (the number of counterclockwise clamp angles in the vertical direction)

1 plt.xticks (rotation=90)2 plt.yticks (rotation=45)

Python Common Library Three: matplotlib

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.