Problems with new colorbar

Hi everyone

First of all I'd like to thank you for all your work
since many bugs which I found to be quite annoying have been
fixed in the latest version.

But I ran into trouble with the new colorbar. As you can see in the
attached picture horizontal lines are drawn.

The plot was generated with the following python code:

from pylab import *
from RandomArray import *

z=random((200,100))
imshow(z, interpolation='nearest', cmap=cm.hot)
colorbar(drawedges=False)
colorbar(drawedges=True)
show()

Any ideas what this problem could be related to?

Best regards,
Nikolai

image.png

···

--
"1984" is not a howto!

Nikolai Hlubek wrote:

Hi everyone

First of all I'd like to thank you for all your work
since many bugs which I found to be quite annoying have been
fixed in the latest version.

But I ran into trouble with the new colorbar. As you can see in the
attached picture horizontal lines are drawn.

The plot was generated with the following python code:

from pylab import *
from RandomArray import *

z=random((200,100))
imshow(z, interpolation='nearest', cmap=cm.hot)
colorbar(drawedges=False)
colorbar(drawedges=True)
show()

Nikolai,

Your example code has two calls to colorbar, but your sample png file has only the result of the second. If I do this:

from pylab import *
from RandomArray import *

z=random((200,100))
imshow(z, interpolation='nearest', cmap=cm.hot)
colorbar(drawedges=False)
show()

I don't get the lines when the Agg backend is making the png. You don't even need the drawedges kwarg; the default is False.

What backends are you using? Some backends still need work to make them support this behavior. Agg, ps, and svg should be fine.

Eric

Hi Eric, hi everyone

Eric Firing wrote:

Your example code has two calls to colorbar, but your sample png file
has only the result of the second. If I do this:

One colorbar should have blue lines the other one should have black
ones. I thought this bug is somehow related to the drawedges command
so I tried both. 'drawedges=True' works and I get black lines.
'drawedges=False' doesn't work for me and I get blue lines.

from pylab import *
from RandomArray import *

z=random((200,100))
imshow(z, interpolation='nearest', cmap=cm.hot)
colorbar(drawedges=False)
show()

I don't get the lines when the Agg backend is making the png. You don't
even need the drawedges kwarg; the default is False.

Yes I know, I thought this would illustrate the behaviour I get a bit
better.

What backends are you using? Some backends still need work to make them
support this behavior. Agg, ps, and svg should be fine.

I'm using the GTK backend.
I tried the GTKAgg and WXAgg backends and there it works.

I just checked and another error I get is also related to the GTK
backend. imshow() always has one pixel errors at different edges. But
with GTKAgg it is aliased away.

Best regards,
Nikolai

···

--
"1984" is not a howto!

Nikolai,

What backends are you using? Some backends still need work to make them
support this behavior. Agg, ps, and svg should be fine.

I'm using the GTK backend.

I have fixed the GTK backend so that linewidth==0 prevents drawing of the boundaries, so colorbar works now.

I tried the GTKAgg and WXAgg backends and there it works.

I just checked and another error I get is also related to the GTK
backend. imshow() always has one pixel errors at different edges. But
with GTKAgg it is aliased away.

I have not looked into this. My suspicion is that it should be regarded as a minor quirk that does no harm in the interactive use for which the GTK backend is suitable.

Eric