Matplotlib ColorbarBase: Removing Color Separators

I want to remove line separators (separators?) In a hand-drawn color map using ColorbarBase:

cm    = get_cmap('RdBu')
Ncol  = 501
cccol = cm(1.*arange(Ncol)/Ncol)
cax     = fig.add_axes([0.15,0.15,0.05,0.4])
fig.add_axes([0.5,0.15,0.3,0.03])
norm    = mpl.colors.Normalize(vmin=valmin, vmax=valmax)
cb1     = mpl.colorbar.ColorbarBase(cax, cmap=cm, norm=norm, orientation='vertical')

It always gives me too many black lines between them. Is there any way to fix them? I have already tried things like:

del cb1.lines
del cb1.dividers

or

cb1.lines.remove()
cb1.lines = []

as shown in the ColorbarBase methods at http://fossies.org/dox/matplotlib-1.2.0/matplotlib_2colorbar_8py_source.html#l00281 .

colorbar with too many black lines

+5
source share
2 answers

I found out that he really was a matplotlib backend!

mpl.use('WXAgg')

solved it!

+1
source

This works for me, without any lines. I see two obvious possibilities:

1) . matplotlib.__version__ python, 1.2.0. OS X 10.6.8 python 2.7.3, macports. ?

2) - , . . ( , .) , ipython --pylab, :

fig    = figure()
valmin =-1.0
valmax =1.0
cm     = get_cmap('RdBu')
Ncol   = 501
cccol  = cm(1.*arange(Ncol)/Ncol)
cax    = fig.add_axes([0.15,0.15,0.05,0.4])
norm   = mpl.colors.Normalize(vmin=valmin, vmax=valmax)
cb1    = mpl.colorbar.ColorbarBase(cax, cmap=cm, norm=norm, orientation='vertical')
draw()
savefig('/tmp/bla.png')

, PNG, , :

Colorbar

? - ?

+2

All Articles