Repository navigation
Colorbar Add kw arguement to colorbar to reenable edges around faces - #1301
jenshnielsen wants to merge 1 commit into
Conversation
the colorbar. Resolve problems with white lines in colorbars. Not enabled by default. See matplotlib#1178 and matplotlib#1188
|
Are we sure it's a problem with the viewer and not with the renderer? |
|
As I understand the problem. The issue is that when you render 2 meshes next to each other, with same start and end coordinates they will at some resolutions be rendered with a gab. According to the poppler bug this has to due with the interpolation to the screen resolution which is also reflected in the fact that it looks different at different resolutions. However I have no idea about if the pdf or svg specs has any thing to say about this behavior. |
|
I'm not enthusiastic about cluttering the API with a kwarg to produce incorrect files because some viewers are buggy. An alternative is for the user to explicitly set the edgecolors: imshow(rand(10,10))
cbar = colorbar()
cbar.solids.set_edgecolor("face")
draw()
|
|
I am inclined to agree with @efiring. @jenshnielsen If you have witnessed this problem with every backend, then this is unlikely to be a bug in matplotlib but an upstream problem. Even if it is a problem with a matplotlib renderer, this change, as @efiring points out, technically produces incorrect figures. |
|
@efiring I didn't realize that it is that that simple to add the edges. I think that it should be sufficient to add that as a workaround to the documentation to for colorbar. Just as simple as the kwarg. You should however realize that this is not just a few viewers. Tested on ubuntu 12.04. evince, okular (libpoppler), pdf.js (more buggy and beta so we can forget about this one), Firefox (svg), Chrome (svg), gnome image viewer (svg) and Inkscape (both pdf import and svg) shows the issue. xpdf is broken in ubuntu as always so i don't know about that one. @dmcdougall Yes and that is what I have written both here and in #1178 and #1188 that it is not a mpl bug. In addition matlab fx. renders the colorbar as an image avoiding the problem. Thus the average user is likely to conclude that this is a bug in matplotlib. If you are ok with adding some info to the colorbar docs suggesting the workaround by @efiring. I will open a new pull request for this (and close this one). |
|
@jenshnielsen Yes, adding a note to the docs is a good idea. |
|
Closing: Documentation updated. See #1315. |
This is an alternative way to resolve problems with white lines in colorbars. It is not enabled by default due to problems with alpha< 1 and colorbar extensions. See #1178 and #1188
This is certainly not the ultimate solution but since it seems difficult to get the viewers fixed this is the simplest workaround that I could come up with.