small scatter plot markers in matplotlib are always black

后端 未结 4 465
后悔当初
后悔当初 2021-02-02 05:47

I\'m trying to use matplotlib to make a scatter plot with very small gray points. Because of the point density, the points need to be small. The problem is that the scatter()

4条回答
  •  一向
    一向 (楼主)
    2021-02-02 06:15

    If the marker has no face (cannot be filled, e.g. '+','x'), then the edgecolor has to be set instead of c, and lw should not be 0:

    scatter([1,2,3], [2,4,5], marker='+', edgecolor='r')
    

    The following will no work

    scatter([1,2,3], [2,4,5], s=1,  marker='+', facecolor='0.5', lw = 0)
    

    because the edge/line will not be displayed, so nothing will be displayed.

提交回复
热议问题