Customizing colorbar border color on matplotlib

后端 未结 2 1875
逝去的感伤
逝去的感伤 2021-02-20 12:10

how can I change the colorbar borders so that they are white and not black (externals border and between each segment)?

For example:

x=randint(100, size=         


        
2条回答
  •  梦毁少年i
    2021-02-20 13:17

    edit: Notice the comments below for MPL 1.3 and later.

    Add:

    cb=colorbar(cs, drawedges=True)
    
    cb.outline.set_color('white')
    cb.outline.set_linewidth(2)
    
    cb.dividers.set_color('white')
    cb.dividers.set_linewidth(2)
    

提交回复
热议问题