why does my colorbar have lines in it?

前端 未结 7 541
清歌不尽
清歌不尽 2020-12-03 02:25

Edit: Since this seems to be a popular post, here\'s the solution that seems to be working well for me. Thanks @gazzar and @mfra.

cbar.solid         


        
7条回答
  •  心在旅途
    2020-12-03 03:12

    In case you create vector graphics, have you tried this (taken from http://matplotlib.org/api/pyplot_api.html?highlight=colorbar#matplotlib.pyplot.colorbar):

    "It is known that some vector graphics viewer (svg and pdf) renders white gaps between segments of the colorbar. This is due to bugs in the viewers not matplotlib. As a workaround the colorbar can be rendered with overlapping segments:

    cbar = colorbar()
    cbar.solids.set_edgecolor("face")
    draw()
    

    However this has negative consequences in other circumstances. Particularly with semi transparent images (alpha < 1) and colorbar extensions and is not enabled by default see (issue #1188)."

提交回复
热议问题