-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
plot_surface: hidden lines re-appearing in PDF and SVG backends #2247
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
Jeff, I could not run your example (after trying to correct the formatting |
Sorry about that; when I posted I wasn't able to see how to mark off a code block (I'm very new here). Just found it. I think it's okay now, I was able to copy and paste into IDLE and it ran. |
No problem. In any case, I was able to reproduce your problem, even in the latest master. So, IIRC, the issue is that various pdf viewers will not understand a linewidth of zero and will enforce a minimum width no matter what. The workaround in your situation is to specify an edgecolor='none' instead of linewidth=0.0. Now, the crazy part is that I could have sworn that we added a check for this condition and handle this automatically in the PDF and SVG backends. @mdboom, thoughts? |
I think this is fixed by #3485. In fact, the pdf specification requires drawing a line of width zero as thin lines (with some implementation-specific width), so it is the responsibility of the pdf producer to omit stroking paths that should not have their outlines drawn. This is different from several other matplotlib backends, where a width of 0 means that the line is not drawn. |
On current master I don't see the problem. The pdf fix did not make it to 1.4.1, but it has been cherry-picked for 1.4.2. I think the svg part has been fixed earlier. |
I'm still seeing the problem with PDF in 1.4.2 (Enthought Canopy installation on MacOS) |
Unfortunately the fix did not make it into 1.4.2 which was released just a few days after 1.4.1 to fix a single serious bug in 1.4.1. It should be in 1.4.3 when that is released. |
I'm generating a 3D surface using plot_surface, intending to save it to a PDF file. I am able to hide the surface lines in the show() display via "linewidth=0", but the lines appear again in some backends.
The PNG backend leaves the lines hidden, SVG shows them as if linewidth=0 were ignored, and PDF shows them with a change of color. Is there a backend problem here?
Attached images are JPG screenshots (they're quite large otherwise), in order: show() output, PNG output, SVG output, PDF output.
I'm using Windows 7 (64-bit), Python 2.7.3 (win32), and MatPlotLib 1.2.0 (win32).
Code follows, and should be executable standalone if anyone wants to try replicating the problem.
The text was updated successfully, but these errors were encountered: