python绘制箱线图

用python绘制箱线图_大奸猫的博客-CSDN博客_python画箱线图

画两个并行的箱型图:
# 导入Excel数据studentshuju.xls的代码:
import matplotlib.pyplot as plt
import pandas as pd
import xlrd
import seaborn as sns
path = "../GCMC/test_dis_att1.csv"
df = pd.read_csv(path)

# df = pd.DataFrame(data)
print(df)

# 做箱式图的代码:
fig = plt.figure()
ax = fig.add_subplot(1, 1, 1)
ax.boxplot(df['topology'])
ax.boxplot((df['topology'], df['feature']),labels=('T','F'))
# plt.show()
plt.savefig('test_dis_att.pdf')#保存箱型图时,去掉show()

你可能感兴趣的:(python,深度学习)