why does my colorbar have lines in it?

前端 未结 7 501
清歌不尽
清歌不尽 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:16

    The following can be another solution even if it is not elegant.

    In [1]: children = cbar.ax.get_children()
    In [2]: children
    Out[2]:
    [<matplotlib.collections.QuadMesh at 0x21783c41b70>,
     <matplotlib.collections.LineCollection at 0x21783bfdc18>,
     <matplotlib.patches.Polygon at 0x21783ba0588>,
     <matplotlib.patches.Polygon at 0x21783beef98>,
     <matplotlib.spines.Spine at 0x21783b77c88>,
     <matplotlib.spines.Spine at 0x21783b77470>,
     <matplotlib.spines.Spine at 0x21783b70c88>,
     <matplotlib.spines.Spine at 0x21783b70860>,
     <matplotlib.axis.XAxis at 0x21783b6ac50>,
     <matplotlib.axis.YAxis at 0x21783ba60f0>,
     <matplotlib.text.Text at 0x21783bc2198>,
     <matplotlib.text.Text at 0x21783bc2320>,
     <matplotlib.text.Text at 0x21783bc22b0>,
     <matplotlib.patches.Rectangle at 0x21783bc2358>]
    In [3]: obj = children[1]  # Get the LineCollection object
    In [4]: obj.set_linewidth(0)
    
    0 讨论(0)
提交回复
热议问题