-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Colorbar outline has broken path in vector backends #4185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Confirmed on master. You are correct: the |
We fixed this on |
Not so surprising: patches.Polygon, because the boundary can be 4, 5, or 6-sided. The problem is in how the vector backends are handling the closed path; agg is handling it correctly. |
Yeah -- it's something pretty fishy. Looking into it now. |
Looks like this was broken last August by me: 40f201c |
Hi again,
In all of the vector graphics backends that I tested (pdf, eps, ps, svg), the colorbar outline is drawn with a broken path at the corner where the path starts and ends. This does not happen with the raster graphic or interactive backends. Here is a minimal working example:
Tested with matplotlib 1.4.3, and python 2.7, on Linux and Windows. I have exaggerated the axes linewidth to make the problem more visible. Here is a screenshot of the PDF output:
I have been able to fix this by making the following change to the
ColorbarBase
class in colorbar.py:This essentially just copies the second point of the path to the end of the path. However, I don't know if this is the best fix. I don't know anything about vector graphics drawing directives, but it seems to me that there should be a builtin function to have paths wrap-around enough so that it creates a closed loop, including drawing the correct corner. Clearly the
closed=True
option of thempatches.Polygon
is not doing this.Again, thanks to anyone who looks into this.
The text was updated successfully, but these errors were encountered: