1说明: 1。1visvis库:是Python视觉库,非常强大。 1。2visvis库:今天讲折线图(line。py)的代码讲解。 1。3安装:pipinstallvisvis本机安装sudopip3。8installvisvis 1。4github:https:github。comalmarkleinvisvis下载,解压 1。5源代码:line。py如本机homexgjDesktopvisvisvisvismastercoreline。py 2环境: 华为笔记本电脑,深度deepinlinux操作系统,python3。8,微软vscode编辑器,谷歌浏览器。 3代码: 3。1plotline。py代码:importvisvisasvvappvv。use()lclinecolor线条颜色;lslinestyle线条样式;lwlinewidth线条宽度msmountstyle节点样式;mwmountwidth节点宽度;mcmountcolor节点颜色mecmountedgecolor节点边缘颜色默认第1组数据是x轴数据,第2组数据是y轴数据,超级简单vv。plot(〔1。5,2,3。2,3。6〕,〔10,30,20,35〕,lcb,ls:,lw3,mcb,mw7,mss,mecr)注意默认对应x轴的数据为〔1,2,3,4〕,下面是y轴的数据vv。plot(〔20,24,45,21〕,lcg,ls,lw3,mcr,mw12,ms,mecg)vv。plot(〔35,14,40,31〕,lcr,ls。,lw3,mcg,mw12,ms,mecb)与上面等同x3〔1,2,3,4〕y3〔35,14,40,31〕vv。plot(xx3,yy3,lcr,ls。,lw3,mcg,mw12,ms,mecb)报错vv。plot(x3,y3,lcr,ls。,lw3,mcg,mw12,ms,mecb)没报错avv。gca()图例与上述对应名称a。legendline1,line2,line3坐标轴的名称,不能显示a。axis。xlabel测量数值a。axis。ylabelsomequantity〔unit〕标题名称,b加粗,{}需要加粗的文字vv。title(Anexampleofb{plotting})vv。title(Anexampleofb{作图})不能显示中文app。Run() 3。2上述图:备注,上述代码是我的理解,真正的意义来自源代码里面,后面有介绍。 3。3源代码:line。py 3。3。1位置:如本机homexgjDesktopvisvisvisvismastercoreline。py 3。3。2介绍: 3。3。2。1缩写及意义: lineWidthlw线条宽度 lineStylels线条样式 lineColorlc线条颜色 markerWidthmw标记宽度 markerStylems标记样式 markerColormc标记颜色 markerEdgeWidthmew标记边缘宽度 markerEdgeColormec标记边缘颜色 3。3。2。2markerStylems标记样式 s:square,d:diamond,:plus,x:cross, :star5,p:star5,h:star6,f:flower, 。:circle,o:circle,v:triangleDown, :triangleUp,:triangleLeft,:triangleRight 4最后: 自己整理,分享出来,喜欢就点赞、收藏和转发。