matplotlib.pyplot箱線圖繪制
讀取csv數(shù)據(jù),并畫出箱線圖
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)
每天快樂(lè)敲代碼,快樂(lè)生活

浙公網(wǎng)安備 33010602011771號(hào)