1.散點圖:(參數(shù):s:點的大小、s:點的大小、marker:形狀、alpha:透明度)
plt.scatter(X,Y, s= ,c= ,marker= ,alpha= )
2.折線圖:(參數(shù):linestyle:線型、color:顏色、marker:形狀)
plt.plot(X,Y)
plt.plot_date(X,Y, linestyle= '-',color=,marker=)? # 時間序列的折線圖
3.條形圖:(參數(shù):color:顏色、width:寬度)
plt.bar(index,X,bar_width,color= )
plt.bar(index+bar_width,X2,bar_width,color= )
plt.bar(index,X2,bar_width,color= ,bottom=X2) # 堆積圖
4.直方圖:(參數(shù):bins:分組、color:顏色、normed:是否標(biāo)準(zhǔn)化)
plt.hist(X,bins=,color='',normed=True) #單變量直方圖
plt.hist2d(X,X2,bins=) #雙變量直方圖
5.餅狀圖:()
plt.pie()
6.子圖:
一、fig=plt.figure()
ax1=fig.add_subplot(221)
ax1.plot()
ax2=fig.add_subplot(222)
ax2.plot()
二、plt.subplot( 221)
plt.subplot( 222)
6.多圖:
7.圖例:(參數(shù):loc:位置、ncol:分列)
plt.plot(x,y,label='')
plt.legend(loc=0,ncol=)? #0:best
# plt.legend(['名1','名2'..])
8.searbon:
plt.style.use({'figure.figsize':(12, 6)}) #設(shè)置圖的大小
sns.countplot(x='',hue='y',hue_order=['','',''],data=df) #條形圖
sns.barplot(x='y',y='x',data=df,order='y 的標(biāo)簽',ax=axes[]) #柱狀圖
sns.swarmplot(x='y',y='x',hue='依據(jù)分組的變量',data=df,order=[y 的標(biāo)簽])
9.調(diào)整圖的大?。?/i>
plt.style.use({'figure.figsize':(12, 5)})