matplotlib.pyplot.scatter()函数用法

参考地址:https://matplotlib.org/api/_as_gen/matplotlib.pyplot.scatter.html?highlight=scatter#matplotlib.pyplot.scatter

 

函数原型:matplotlib.pyplot.scatter(xys=Nonec=Nonemarker=Nonecmap=Nonenorm=Nonevmin=Nonevmax=Nonealpha=Nonelinewidths=Noneverts=Noneedgecolors=None*data=None**kwargs)

 

参数解释:x,y:数据坐标

     s:散点的大小

                  c:散点的颜色 如果输入int就会自动生成指定数量种类的颜色给散点显示 如c=3就会生成3种不同颜色的散点

                  marker:散点的形状,参数对应表如下:

markersymboldescription
"."m00point
","m01pixel
"o"m02circle
"v"m03triangle_down
"^"m04triangle_up
"<"m05triangle_left
">"m06triangle_right
"1"m07tri_down
"2"m08tri_up
"3"m09tri_left
"4"m10tri_right
"8"m11octagon
"s"m12square
"p"m13pentagon
"P"m23plus (filled)
"*"m14star
"h"m15hexagon1
"H"m16hexagon2
"+"m17plus
"x"m18x
"X"m24x (filled)
"D"m19diamond
"d"m20thin_diamond
"|"m21vline
"_"m22hline
0 (TICKLEFT)m25tickleft
1 (TICKRIGHT)m26tickright
2 (TICKUP)m27tickup
3 (TICKDOWN)m28tickdown
4 (CARETLEFT)m29caretleft
5 (CARETRIGHT)m30caretright
6 (CARETUP)m31caretup
7 (CARETDOWN)m32caretdown
8 (CARETLEFTBASE)m33caretleft (centered at base)
9 (CARETRIGHTBASE)m34caretright (centered at base)
10 (CARETUPBASE)m35caretup (centered at base)
11 (CARETDOWNBASE)m36caretdown (centered at base)
"None"" or "" nothing
'$...$'m37Render the string using mathtext. E.g "$f$" for marker showing the letter f.
verts A list of (x, y) pairs used for Path vertices. The center of the marker is located at (0,0) and the size is normalized, such that the created path is encapsulated inside the unit cell.
path Path instance.
(numsides, style, angle) 

The marker can also be a tuple (numsides, style, angle), which will create a custom, regular symbol.

numsides:
the number of sides
style:

the style of the regular symbol:

  • 0: a regular polygon
  • 1: a star-like symbol
  • 2: an asterisk
  • 3: a circle (numsides and angle is ignored); deprecated.
angle:
the angle of rotation of the symbol

    cmap:指定颜色映射

    norm,vmin,vmax..:都是亮度,外观相关设置详见顶部网址。

转载于:https://www.cnblogs.com/ZengWeiHao/p/9992269.html

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值