matplotlib.pyplot箱线图绘制
读取csv数据,并画出箱线图
import matplotlib.pyplot as plt
import pandas as pd
def draw_box(csv_file_path):
data = pd.read_csv(csv_file_path, encoding='utf-8')
plt.rc('font', family='Times New Roman')
data = data.iloc[:, 1:]
data.plot.box(title="difficulty rating")
plt.grid(linestyle="--", alpha=0.3)
plt.savefig('./results_imgs.png', bbox_inches='tight', dpi=300)
每天快乐敲代码,快乐生活