在线精品99_中国九九盗摄偷拍偷看_91免费版在线观看_91.app_91高清视频在线_99热最新网站

Python matplotlib Line2D对象怎么用

154次阅读
没有评论

共计 2915 个字符,预计需要花费 8 分钟才能阅读完成。

这篇文章主要介绍 Python matplotlib Line2D 对象怎么用,文中介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们一定要看完!

总括

matplotlib.pyplot 很像 MATLAB。它的每一个函数都会对现有的图形进行更改:比如建立一个图形(figure),创建画图区域,在画图区域做出线条,使用标签装饰。
如果你传入了一个简单的 list 或者 array,matplotlib 会把它当成 y 值,并自动生成 x 值。事实上所有序列都会被转换为 numpy arrays。

import matplotlib.pyplot as plt
plt.plot([1,2,3,4])
plt.ylabel(some numbers)
plt.show()

当你传入两个 list 或者 array 时,第一个会被当成 x 值,第二个会被当成 y 值,而且你可以通过第三个参数设置显示的形状和颜色(这是一个组合),当然你也可以分别设置形状和颜色。通过 plt.axis(xmin, xmax, ymin, ymax)函数你可以设置 x 轴,y 轴的最大值和最小值:

import matplotlib.pyplot as plt
plt.plot([1,2,3,4], [1,4,9,16],  ro )
plt.axis([0, 6, 0, 20])
plt.show()

Line2D 对象 Line2D

Bases: matplotlib.artist.Artistclass matplotlib.lines.Line2D(xdata, ydata, linewidth=None, line > 属性控制 

有三种方式设置线的属性
1)直接在 plot()函数中设置

plt.plot(x, y, linewidth=2.0)

2)通过获得线对象,对线对象进行设置

line, = plt.plot(x, y,  -)line.set_antialiased(False) # turn off antialising

3)获得线属性,使用 setp()函数设置

lines = plt.plot(x1, y1, x2, y2)# use keyword argsplt.setp(lines, color= r , linewidth=2.0)

PropertyValue Typealphafloatanimated[True False]antialiased or aa[True False]clip_boxa matplotlib.transform.Bbox instanceclip_on[True False]clip_patha Path instance and a Transform instance, a Patchcolor or cany matplotlib colorcontainsthe hit testing functiondash_capstyle[‘butt’‘round’‘projecting’]dash_joinstyle[‘miter’‘round’‘bevel’]dashessequence of on/off ink in pointsdata(np.array xdata, np.array ydata)figurea matplotlib.figure.Figure instancelabelany stringlinestyle or ls[‘-’‘–’‘-.’‘:’‘steps’…]linewidth or lwfloat value in pointslod[True False]marker[‘+’‘,’‘.’‘1’‘2’‘3’‘4’]markeredgecolor or mecany matplotlib colormarkeredgewidth or mewfloat value in pointsmarkerfacecolor or mfcany matplotlib colormarkersize or msfloatmarkevery[None integer (startind, stride) ]pickerused in interactive line selectionpickradiusthe line pick selection radiussolid_capstyle[‘butt’‘round’‘projecting’]solid_joinstyle[‘miter’‘round’‘bevel’]transforma matplotlib.transforms.Transform instancevisible[True False]xdatanp.arrayydatanp.arrayzorderany numberlinestyledescription‘-‘?or?’solid’solid line‘–’?or?’dashed’dashed line‘-.’?or?’dashdot’dash-dotted line‘:’?or?’dotted’dotted line‘None’draw nothing‘?’draw nothing”draw nothingmarkerdescription“.”point“,”pixel“o”circle“v”triangle_down“^”triangle_up“”triangle_left“”triangle_right“1”tri_down“2”tri_up“3”tri_left“4”tri_right“8”octagon“s”square“p”pentagon“P”plus (filled)“*”star“h”hexagon1“H”hexagon2“+”plus“x”x“X”x (filled)“D”diamond“d”thin_diamond“““_”hlineTICKLEFTtickleftTICKRIGHTtickrightTICKUPtickupTICKDOWNtickdownCARETLEFTcaretleft (centered at tip)CARETRIGHTcaretright (centered at tip)CARETUPcaretup (centered at tip)CARETDOWNcaretdown (centered at tip)CARETLEFTBASEcaretleft (centered at base)CARETRIGHTBASEcaretright (centered at base)CARETUPBASEcaretup (centered at base)“None”,?”?”?or?”“nothing‘...’render the string using mathtext.vertsa list of (x, y) pairs used for Path vertices. The center of the marker is located at (0,0) and the size is normalized.patha?Path?instance.

以上是“Python matplotlib Line2D 对象怎么用”这篇文章的所有内容,感谢各位的阅读!希望分享的内容对大家有帮助,更多相关知识,欢迎关注丸趣 TV 行业资讯频道!

正文完
 
丸趣
版权声明:本站原创文章,由 丸趣 2023-08-17发表,共计2915字。
转载说明:除特殊说明外本站除技术相关以外文章皆由网络搜集发布,转载请注明出处。
评论(没有评论)
主站蜘蛛池模板: 国产成人精品免费视频 | 久久日本片精品aaaaa国产 | 白嫩少妇bbw撒尿视频 | 日本高中生一级乇片 | 蜜臀av性久久久久蜜臀aⅴ麻豆 | 一级特黄特黄毛片欧美的 | 亚洲成a人片在线观看www | 国产精品国产精品国产专区不卡 | 日本一级爽快片淫片 | 55夜色66夜色国产精品视频 | 日本怡春院一区二区三区 | 午夜视频国语 | 69av在线视频 | 久久99国产精品久久99 | 亚洲国产欧美在线 | 久久久在线视频 | 99久久精品国产自免费 | 亚洲在线国产日韩欧美 | 国产三区在线成人av | 女性特黄一级毛片 | 在线视频观看免费视频18 | 亚洲欧美日韩国产综合久 | 免费视频久久看 | 日本爱爱网址 | 免费一级国产大片 | 手机午夜视频 | 成人男女网18免费0 成人男女网18免费91 | 精品亚洲国产成av人片传媒 | 一级黄色大片视频 | 一级做a爱片特黄在线观看yy | 精品伊人久久久香线蕉 | 亚洲精品国产一区二区三 | 亚洲精品久久久久久久观小说 | 日本伦理电影网址 | 无码人妻精品一区二区三区久久久 | 久久99久久99精品观看 | 熟女人妻在线视频 | 少妇精品导航 | 日韩av无码精品人妻系列 | 少女韩国电视剧在线观看完整 | 99在线视频精品费观看视 |