怎么在python中使用Matplotlib绘制分布点

发布时间:2021-04-30 16:56:49 作者:Leah
来源:亿速云 阅读:132

怎么在python中使用Matplotlib绘制分布点?针对这个问题,这篇文章详细介绍了相对应的分析和解答,希望可以帮助更多想解决这个问题的小伙伴找到更简单易行的方法。

python主要应用领域有哪些

1、云计算,典型应用OpenStack。2、WEB前端开发,众多大型网站均为Python开发。3.人工智能应用,基于大数据分析和深度学习而发展出来的人工智能本质上已经无法离开python。4、系统运维工程项目,自动化运维的标配就是python+Django/flask。5、金融理财分析,量化交易,金融分析。6、大数据分析。

import matplotlib.pyplot as plt
from numpy.random import rand
import numpy
import os
import cv2

#setting plt
plt.xlim(xmax=100,xmin=0)
plt.ylim(ymax=100,ymin=0)
plt.xlabel("height")
plt.ylabel("width")


path_1 = r'D:\zhangjichao\view\V7_scale_2\path_1'


x = []
y = []
files = os.listdir(path_1)
for f in files:
  img = cv2.imread(path_1 + '\\' + f)
  x.append(img.shape[0])
  y.append(img.shape[1])
plt.plot(x,y,'ro',color='red',label='path_1')

path_2 = r'D:\zhangjichao\view\V7_scale_2\path_2'

x = []
y = []
files = os.listdir(path_2)
for f in files:
  img = cv2.imread(path_2 + '\\' + f)
  x.append(img.shape[0])
  y.append(img.shape[1])
plt.plot(x,y,'ro',color='red',label='path_2')

path_3 = r'D:\zhangjichao\view\V7_scale_2\path_3'


x = []
y = []
files = os.listdir(path_3)
for f in files:
  img = cv2.imread(path_3 + '\\' + f)
  x.append(img.shape[0])
  y.append(img.shape[1])
plt.plot(x,y,'ro',color='red',label='path_3')

path_4 = r'D:\zhangjichao\view\V7_scale_2\path_4'

x = []
y = []
files = os.listdir(path_4)
for f in files:
  img = cv2.imread(path_4 + '\\' + f)
  x.append(img.shape[0])
  y.append(img.shape[1])
plt.plot(x,y,'ro',color='red',label='path_4')

yujing = r'D:\zhangjichao\view\V7_scale_2\xujing_org_scale_2'

x = []
y = []
files = os.listdir(yujing)
for f in files:
  img = cv2.imread(yujing + '\\' + f)
  x.append(img.shape[0])
  y.append(img.shape[1])
plt.plot(x,y,'ro',color='green' , label='xujing')
for i in range(1,len(x)):
  plt.text(x[i],y[i],str((x[i],y[i])), family='serif', style='italic', ha='right', wrap=True)

plt.legend(loc='upper center', shadow=True, fontsize='x-large')
plt.grid(True)


plt.show()

截图

怎么在python中使用Matplotlib绘制分布点

关于怎么在python中使用Matplotlib绘制分布点问题的解答就分享到这里了,希望以上内容可以对大家有一定的帮助,如果你还有很多疑惑没有解开,可以关注亿速云行业资讯频道了解更多相关知识。

推荐阅读:
  1. 详解Python如何使用matplotlib绘制圆形
  2. 怎么在Python中利用matplotlib绘制矩形

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

python matplotlib

上一篇:怎么在python中利用栈和队列模拟递归

下一篇:怎么在python3中使用psutil检测系统性能信息

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》