import matplotlib.pyplot as plt
print(result1)
y = result1
x = [2,3,4]
#设置坐标轴名称
plt.xlabel('the value of k')
plt.ylabel('Silhouette Coefficient')
#设置坐标轴刻度
plt.xticks([2,3,4])
# plt.title("Silhouette Coefficient")
#画曲线
plt.plot(x,y)
#画点
plt.scatter(x,y)
plt.savefig('../clusting_image' + '/' +
python中matplotlib绘制折线图(一)
最新推荐文章于 2024-06-14 21:05:29 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)