pandas绘制多图多标题

import numpy as np  
import pandas as pd
import seaborn as sns  
import matplotlib.pyplot as plt  

sns.set( palette="muted", color_codes=True)  
#rs = np.random.RandomState(10)  

#d = rs.normal(size=100)  
d = pd.read_csv('c:/Users/MaiBenBen/Desktop/kde/nicetable.csv',encoding='gbk')
#d = pd.read_csv('nicetable.csv')
#d.sorted_values('Area',inplace=True,ascending=True) 
#d = pd.read_csv('c:\Users\MaiBenBen\Desktop\nicetable.csv',usecols=['Area'],encoding='gbk')
#d.loc[:,'Area']
#sns.distplot(d.loc['Area']
f, axes = plt.subplots(3, 2, figsize=(7, 7), sharex=True)  

sns.distplot(d.loc[:,'Diameter'], kde=False, color="b", ax=axes[0, 0])  
plt.title('Density Plot of Rock Fragmentation', fontsize=22)
#sns.distplot(d.loc[:,'Area'], hist=False, rug=True, color="r", ax=axes[0, 1])  
sns.distplot(d.loc[:,'Diameter'], hist=False, color="g", kde_kws={"shade": True}, ax=axes[0, 1])  

sns.distplot(d.loc[:,'Diameter'], color="m", ax=axes[1, 0])  

sns.kdeplot(d.loc[:,'Diameter'],cumulative=True, ax=axes[1, 1])

sns.distplot(d.loc[:,'Diameter'], color="m", ax=axes[2, 0])  

sns.kdeplot(d.loc[:,'Diameter'],cumulative=True, ax=axes[2, 1])


# Decoration

plt.suptitle('Density Plot of City Mileage by Vehicle Type', fontsize=22)

axes[0,0].set_title('333')
axes[0,1].set_title('4444')
axes[1,0].set_title('55555')
axes[1,1].set_title('666666')
axes[2,0].set_title('7777777')
axes[2,1].set_title('88888888')

plt.legend()

plt.show()  

 

 

pandas绘制多图多标题_第1张图片

你可能感兴趣的:(python与opencv,编程点滴)