介绍
怎么在python中使用Matplotlib绘制分布点?针对这个问题,这篇文章详细介绍了相对应的分析和解答,希望可以帮助更多想解决这个问题的小伙伴找到更简单易行的方法。
python主要应用领域有哪些
1,云计算,典型应用OpenStack.2,网前端开发,众多大型网站均为python开发。3。人工智能应用,基于大数据分析和深度学习而发展出来的人工智能本质上已经无法离开python.4,系统运维工程项目,自动化运维的标配就是python + Django/flask.5,金融理财分析,量化交易,金融分析。6,大数据分析。
import matplotlib.pyplot as plt 得到numpy.random import 兰德 import numpy import 操作系统 import cv2 # setting plt plt.xlim (xmax=100, xmin=0) plt.ylim (ymax=100, ymin=0) plt.xlabel (“height") plt.ylabel (“width") 时间=path_1 " # 39; D: \ V7_scale_2 \ \ zhangjichao \视图path_1& # 39; 时间=x [] 时间=y [] 时间=files os.listdir (path_1) for f 拷贝文件: img 才能=,cv2.imread(时间+ path_1 & # 39; \ \ & # 39;, +, f) x.append才能(img.shape [0]) y.append才能(img.shape [1]) plt.plot (x, y, & # 39; ro # 39;,颜色=& # 39;红色# 39;,标签=& # 39;path_1& # 39;) 时间=path_2 " # 39; D: \ V7_scale_2 \ \ zhangjichao \视图path_2& # 39; 时间=x [] 时间=y [] 时间=files os.listdir (path_2) for f 拷贝文件: img 才能=,cv2.imread(时间+ path_2 & # 39; \ \ & # 39;, +, f) x.append才能(img.shape [0]) y.append才能(img.shape [1]) plt.plot (x, y, & # 39; ro # 39;,颜色=& # 39;红色# 39;,标签=& # 39;path_2& # 39;) 时间=path_3 " # 39; D: \ V7_scale_2 \ \ zhangjichao \视图path_3& # 39; 时间=x [] 时间=y [] 时间=files os.listdir (path_3) for f 拷贝文件: img 才能=,cv2.imread(时间+ path_3 & # 39; \ \ & # 39;, +, f) x.append才能(img.shape [0]) y.append才能(img.shape [1]) plt.plot (x, y, & # 39; ro # 39;,颜色=& # 39;红色# 39;,标签=& # 39;path_3& # 39;) 时间=path_4 " # 39; D: \ V7_scale_2 \ \ zhangjichao \视图path_4& # 39; 时间=x [] 时间=y [] 时间=files os.listdir (path_4) for f 拷贝文件: img 才能=,cv2.imread(时间+ path_4 & # 39; \ \ & # 39;, +, f) x.append才能(img.shape [0]) y.append才能(img.shape [1]) plt.plot (x, y, & # 39; ro # 39;,颜色=& # 39;红色# 39;,标签=& # 39;path_4& # 39;) 时间=yujing " # 39; D: \ V7_scale_2 \ \ zhangjichao \视图xujing_org_scale_2& # 39; 时间=x [] 时间=y [] 时间=files os.listdir(茎) for f 拷贝文件: img 才能=,cv2.imread(时间+ yujing & # 39; \ \ & # 39;, +, f) x.append才能(img.shape [0]) y.append才能(img.shape [1]) plt.plot (x, y, & # 39; ro # 39;,颜色=& # 39;绿色# 39;,,,标签=& # 39;xujing& # 39;) for 小姐:拷贝范围(len (x)): plt.text才能(x[我],[我],str ((x[我],[我])),,家庭=& # 39;衬线# 39;,,风格=& # 39;斜体# 39;,,哈=& # 39;对# 39;,,包=True) plt.legend (loc=& # 39; upper 中心# 39;,,影子=True,字形大?& # 39;超大号# 39;) plt.grid(真正的) plt.show ()
截图
关于怎么在python中使用Matplotlib绘制分布点问题的解答就分享到这里了,希望以上内容可以对大家有一定的帮助,如果你还有很多疑惑没有解开,可以关注行业资讯频道了解更多相关知识。