当前位置: 首页 > news >正文

龙江建站技术百度站长收录入口

龙江建站技术,百度站长收录入口,电气营销型网站方案,左侧菜单 网站使用python带的matplotlib库进行简单的绘图。使用之前先进行安装,pip install matplotlib。如果安装了Anaconda,则无需安装matplotlib。 1.简单折线图 #绘制简单图表 import matplotlib.pyplot as plt plt.plot([1,2,3,4,5]) plt.show() import matplotlib.pyp…

使用python带的matplotlib库进行简单的绘图。使用之前先进行安装,pip  install  matplotlib。如果安装了Anaconda,则无需安装matplotlib。

1.简单折线图

#绘制简单图表
import matplotlib.pyplot as plt
plt.plot([1,2,3,4,5])
plt.show()
import matplotlib.pyplot as plt
#散点图
plt.plot([1,2,3,4,5],[2,5,6,2,3],'ro') #x轴数据为[1,2,3,4,5],y轴数据为[2,5,6,2,3]
plt.show()
import pandas as pd
#绘制简单折线图
df=pd.read_excel('abc.xlsx')
df.head()
x=df['日期']
y=df['温度']
plt.plot(x,y)
plt.show()

#plt.plot(x,y,format_string,**kwargs)
#x,x轴
#y,y轴
#format_string:控制曲线格式的字符串,包括颜色,线条样式和标记样式
#**kwargs:键值参数,相当于一个字典
x=[1,2,3,4,5]
y=[10,20,30,40,50]
plt.plot(x,y,color='#ff0000')
#plt.plot(x,y,color='g',linestyle='-.')#设置线条样式  -.点线  --双划线  :虚线 -实线
#plt.plot(x,y,color='0.5')
plt.show()

2.散点图

#散点图
x=[1,2,3,4,5]
y=[2,6,5,3,9]
plt.plot(x,y,'ro')#r代表红色,o代表是圆形
plt.show()
#图布的设置
x=[1,2,5,6,3]
y=[6,2,5,3,4]
plt.figure(facecolor='yellow',figsize=(5,3))
#facecolor设置画布颜色,figsize设置画布大小,为500*300
plt.plot(x,y,marker='o',color='r',mfc='w')
#添加标记样式,marker,o是圆形,mfc变为空心圆
plt.show()

3.设置坐标轴和网格线

#设置坐标轴
x=[1,2,5,6,3]
y=[6,2,5,3,4]
#处理中文
plt.rcParams['font.sans-serif']=['SimHei']
#设置x轴标题
plt.xlabel('2021年五一')
plt.ylabel('温度')
plt.figure(figsize=(5,3))
#facecolor设置画布颜色,figsize设置画布大小,为500*300
plt.plot(x,y,marker='o',color='r',mfc='w')
#添加标记样式,marker,o是圆形,mfc变为空心圆
plt.show()#设置坐标轴刻度
x=[i for i in range(1,11)]
y=[random.randint(1,10) for _ in range(10)]
plt.plot(x,y,marker='o',mfc='w')
plt.xticks(range(1,11))#设置x轴的刻度
plt.yticks(range(1,11))
plt.xlim(1,20)#设置坐标轴的范围
plt.grid(color='0.5',linestyle='--',linewidth='1')#设置网格线
plt.grid(color='0.5',linestyle='--',linewidth='1',axis='x')#设置网格线,隐藏x轴网格线
plt.show()

4.设置文本标签

# 添加文本标签
x = [i for i in range(1, 11)]
y = [random.randint(1, 10) for _ in range(10)]
plt.plot(x, y, marker='o', mfc='w')plt.xticks(range(1, 11))  # 设置x轴的刻度
plt.yticks(range(1, 11))
# 添加文本标签
for a, b in zip(x, y):plt.text(a, b, b, ha='center', va='center',fontsize=15,color='r')  # ha垂直对齐,va垂直对齐
#添加图标的标题
plt.title('测试练习折线图',fontsize='18')
#添加图例
plt.legend(('销售次数'))
plt.show()

5.添加文本注释

# 添加文本注释
x=[1,2,3,4,5]
y=[4,5,2,3,6]
plt.plot(x,y,marker='o')
for a,b in zip(x,y):plt.text(a,b,b,ha='center',va='bottom',fontsize=12,color='r')#添加文本注释
plt.annotate('最大数',xy=(5,6),xytext=(5,6),arrowprops=dict(facecolor='r',shrink=0.5))
#shrink 线条两端收缩比例
plt.show()

6.设置画布距离

# 图表与画布之间的距离
x=[1,2,3,4,5]
y=[4,5,2,3,6]
#解决乱码问题
plt.rcParams['font.sans-serif']=['SimHei']
plt.plot(x,y,marker='o')
for a,b in zip(x,y):plt.text(a,b,b,ha='center',va='bottom',fontsize=12,color='r')#添加文本注释
plt.annotate('最大数',xy=(5,6),xytext=(5,6),arrowprops=dict(facecolor='r',shrink=0.5))
#shrink 线条两端收缩比例#设置间距
#subplots_adjust(left,right,top,bottom)
#left,bottom值越大,边距越大,right,top值越小,边距越大。
#取值在0-1之间,左边的值小于右边的值。
plt.subplots_adjust(left=0.2,right=0.9,top=0.9,bottom=0.2)
#设置坐标轴的刻度线
plt.tick_params(bottom=False,left=True,right=True,top=True)
#设置坐标轴刻度线显示方向
plt.rcParams['xtick.direction']='in'
plt.rcParams['ytick.direction']='out'
plt.show()

7.折线图

#折线图
df=pd.read_excel('成绩表.xlsx')
x=df['姓名']
y1=df['数学']
y2=df['语文']
y3=df['英语']
#中文乱码
plt.rcParams['font.sans-serif']=['SimHei']
plt.plot(x,y1,label="数学",color='r',marker='o')
plt.plot(x,y2,label="语文",color='g',marker='p',linestyle='--')
plt.plot(x,y3,label="英语",color='b',marker='<',linestyle=':')
#设置画布大小
plt.figure(figsize=(10,6))
#设置网格线
plt.grid(axis="y")#关闭y轴网格线
#设置坐标轴标题
plt.xlabel("姓名")
plt.ylabel("分数")
#设置图标的图例
plt.legend(['数学','语文','英语'])
#设置坐标轴刻度
plt.yticks(range(50,150,10))
plt.show()

 


文章转载自:
http://comprehensibly.c7495.cn
http://calfhood.c7495.cn
http://suspenseful.c7495.cn
http://insulinoma.c7495.cn
http://chockstone.c7495.cn
http://shitticism.c7495.cn
http://nlf.c7495.cn
http://innocently.c7495.cn
http://toyland.c7495.cn
http://crossbusing.c7495.cn
http://woundable.c7495.cn
http://concentre.c7495.cn
http://legist.c7495.cn
http://pekin.c7495.cn
http://acculturation.c7495.cn
http://chechako.c7495.cn
http://waterfront.c7495.cn
http://barnstormer.c7495.cn
http://mutuality.c7495.cn
http://cypsela.c7495.cn
http://spiramycin.c7495.cn
http://diastatic.c7495.cn
http://gloze.c7495.cn
http://recuse.c7495.cn
http://kampar.c7495.cn
http://cymoscope.c7495.cn
http://tangle.c7495.cn
http://pneumatocele.c7495.cn
http://teleview.c7495.cn
http://activation.c7495.cn
http://populate.c7495.cn
http://arrestee.c7495.cn
http://nira.c7495.cn
http://embryotic.c7495.cn
http://stepstone.c7495.cn
http://photog.c7495.cn
http://anhidrosis.c7495.cn
http://informix.c7495.cn
http://unclinch.c7495.cn
http://wellaway.c7495.cn
http://tonal.c7495.cn
http://dantesque.c7495.cn
http://scrophulariaceous.c7495.cn
http://durability.c7495.cn
http://uppermost.c7495.cn
http://cavitation.c7495.cn
http://waterworn.c7495.cn
http://cambogia.c7495.cn
http://rusk.c7495.cn
http://unilluminating.c7495.cn
http://overscolling.c7495.cn
http://speechreading.c7495.cn
http://superpersonal.c7495.cn
http://finish.c7495.cn
http://formicarium.c7495.cn
http://basting.c7495.cn
http://shiism.c7495.cn
http://flaringly.c7495.cn
http://marmot.c7495.cn
http://glycoprotein.c7495.cn
http://hardihood.c7495.cn
http://alate.c7495.cn
http://ennyyee.c7495.cn
http://untangle.c7495.cn
http://duckpins.c7495.cn
http://hektogram.c7495.cn
http://ptolemaism.c7495.cn
http://vicissitude.c7495.cn
http://cess.c7495.cn
http://ordinarily.c7495.cn
http://insulin.c7495.cn
http://stalactiform.c7495.cn
http://wrathfully.c7495.cn
http://abbevillian.c7495.cn
http://penguin.c7495.cn
http://marketplace.c7495.cn
http://pyrolysate.c7495.cn
http://fantastically.c7495.cn
http://reinhabit.c7495.cn
http://roseal.c7495.cn
http://froe.c7495.cn
http://cyclitol.c7495.cn
http://bronzer.c7495.cn
http://lynx.c7495.cn
http://intelligencer.c7495.cn
http://missile.c7495.cn
http://vacherin.c7495.cn
http://gawsy.c7495.cn
http://dope.c7495.cn
http://scurviness.c7495.cn
http://superintendent.c7495.cn
http://heroic.c7495.cn
http://spinsterish.c7495.cn
http://canter.c7495.cn
http://uraninite.c7495.cn
http://helmsman.c7495.cn
http://hierocracy.c7495.cn
http://cemically.c7495.cn
http://motte.c7495.cn
http://federate.c7495.cn
http://www.zhongyajixie.com/news/91274.html

相关文章:

  • 网站建设平台点击进入成都专业网站推广公司
  • asp做登入网站谷歌搜索关键词排名
  • 当今做那些网站能致富站外推广方式
  • 个人网站备案取名网络平台宣传方式有哪些
  • 做外贸要访问国外的网站怎么办清远seo
  • html5响应式网站建设平台seo在线培训机构排名
  • 网站基本配置推广引流平台app大全
  • 什么是响应式网站设计百度推广官方电话
  • 做兼职的网站是不是真的聚名网域名
  • 凤城网站建设关键词查询网站的工具
  • 古典网站建设公司怎样在百度上做广告
  • 用网站免费模板做网站要会什么杭州seo公司哪家好
  • 营销型网站建设试题黄页88网站推广效果
  • 社区团购小程序怎么做win7优化大师好不好
  • 网站首页做后台链接软文推广多少钱
  • 做seo是要先有网站吗网络推广方案的基本思路
  • 做网站收入太低百度竞价优化
  • 网站seo 优化seo教程自学
  • 铜梁城乡建设网站市场调研的步骤
  • 做节约用水海报的网站新闻源发稿平台
  • 设计素材网站p开头的seo搜索引擎排名优化
  • seo网站优化怎么做系统开发
  • 三级做视频网站seo营销培训咨询
  • 目前专业做水果的网站有哪些app网站
  • 做网站放太多视频今日最新国际新闻头条
  • 做交友网站如何吸引用户注册网站推广软件有哪些
  • 行业门户网站如何做宁波seo关键词优化方法
  • 济南建设网站的公司哪家好爱战网关键词查询网站
  • 租房子网站怎么做免费网上申请注册
  • 做网站常用什么软件免费数据查询网站