Implement dash pattern scaling in pdf#6590
Implement dash pattern scaling in pdf#6590jkseppan wants to merge 3 commits intomatplotlib:masterfrom
Conversation
Factor the dash pattern scaling into a separate function so GraphicsContextPdf.delta can call it. Combine the linewidth and dash comparisons because now linewidth affects dashing. Fixes matplotlib#6588
|
This might also address the pdf related issue brought up in #5430 |
|
@tacaswell About your comment on #5430 , are you sure there is an issue with the PDF backend and the offset negative values? Because the produced PDF file looks fine to me, with and without jkseppan's fix (I rapidly copy-pasted his fix and re-tested it on #5430 MWE). |
|
@afvincent Yes, sorry 2nd time being wrong about that 😞 |
|
I don't think this patch does anything for #5430. It would be a small change, though. |
I think the pdf specification implies that the offset should be nonnegative.
|
@jkseppan: This looks good and I'd like to get this in for the next release candidate. Would you mind updating the test images so everything passes? |
|
The lw related computation probably needs to be pulled all they way up into |
|
@mdboom: I added new baseline images, but now I'm not so sure this fixes the difference between backends. If you compare the files |
| if offset is None or dash is None: | ||
| dash = [] | ||
| offset = 0 | ||
| if sum(dash) > 0: |
There was a problem hiding this comment.
This check should probably be moved up into the base class?
|
Something is not right that this is leaking into the tests under the classic style. I have an idea of how to fix this and #6592, but am not completely sure it will work. |
When scaling the dash pattern by the linewidth do the scaling at artist creation / value set time rather than at draw time. closes matplotlib#6592 closes matplotlib#6588 closes matplotlib#6590 Closes matplotlib#6693 closes matplotlib#5430
Factor the dash pattern scaling into a separate function so
GraphicsContextPdf.deltacan call it. Combine the linewidth and dash comparisons because now linewidth affects dashing.Fixes #6588
I didn't see if this breaks anything else, it's likely to change the test results for all tests with dashed lines.