0
点赞
收藏
分享

微信扫一扫

python观察日志(part23)--更改图片尺寸并保存

古月无语 2022-06-02 阅读 75

学习笔记,仅供参考,有错必纠

更改图片尺寸并保存

image_path = "{}/k{}_max_time{}.jpg".format(file_path, k, max_time)
plt.figure(figsize = (9, 3))
plt.subplot(131)
plt.title('knn\'k: {}, max_times: {}, is_label_eq: {}\n n_components: {}, n_components2: {}'.format(k,
max_time, is_label_eq, n_components, n_components2))
plt.scatter(X[:, 0], X[:, 1], c = y)
plt.subplot(132)
plt.scatter(X[:, 0], X[:, 1], c = label)
plt.subplot(133)
plt.scatter(X[:, 0], X[:, 1], c = label2)

plt.savefig(image_path, bbox_inches = 'tight')


举报

相关推荐

0 条评论