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