#化直线
plt.semilogx(c_range,train_scores_mean,label='Training score',
color='darkorange',lw=lw)
#画直线上下的偏移,然后进行涂色
plt.fill_between(c_range,train_scores_mean-train_scores_std,
train_scores_mean+train_scores_std,
alpha=0.2,
color='darkorange',lw=lw) #第一个参数是x的范围 然后是上偏移量 下偏移量
本文讲解了如何使用Python的matplotlib库来绘制半对数坐标系下的定量分析图表,包括如何绘制直线以及如何通过填充颜色来表示数据的上下偏移,这对于理解和展示数据的波动性非常有用。

被折叠的 条评论
为什么被折叠?



