Skip to content

Hatching is rendered differently by agg, pdf and svg backends. #10034

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

Open
anntzer opened this issue Dec 18, 2017 · 5 comments · May be fixed by #29392
Open

Hatching is rendered differently by agg, pdf and svg backends. #10034

anntzer opened this issue Dec 18, 2017 · 5 comments · May be fixed by #29392
Labels
backend: pdf backend: svg keep Items to be ignored by the “Stale” Github Action topic: hatch

Comments

@anntzer
Copy link
Contributor

anntzer commented Dec 18, 2017

Bug report

Bug summary

The baseline images for the test_clipping test (clip_path_clipping.{png,pdf,svg}) clearly show differences in rendering between agg, pdf and svg:
clip_path_clipping

top left is the svg baseline rendered by inkview (inkscape) 0.92.2, top right is the png baseline, bottom left is the pdf baseline rendered by okular 17.08.3, bottom right is the pdf baseline rendered by gs 9.22 (gs is used by the testing framework to rasterize the pdf for image comparisons).

Code for reproduction

N/A

Actual outcome

  • the colors of the stars are slightly different between png and svg.
  • the pdf backend render the stars as empty rather than filled.

Expected outcome

All three backends should render hatching in a similar manner.

(As a side note, mplcairo generates pdf and svg that render like the png.)

Matplotlib version

  • Operating system:
  • Matplotlib version: master
  • Matplotlib backend (print(matplotlib.get_backend())):
  • Python version:
  • Jupyter version (if applicable):
  • Other libraries:
@tacaswell tacaswell added this to the v2.2 milestone Dec 18, 2017
@tacaswell
Copy link
Member

I thought this was something we fixed in 2.0

@QuLogic
Copy link
Member

QuLogic commented Apr 21, 2023

The difference in colour is the same as #10035, as all the artists have alpha.

@QuLogic
Copy link
Member

QuLogic commented Apr 21, 2023

It's strange that there's a difference, as PDF uses a Op.fill_stroke, and the resulting SVG does have both a fill and stroke defined in the pattern. Oops, misread the results from SVG; it's just the alpha that's wrong there.

BTW, does this come out correctly in mplcairo?

@anntzer
Copy link
Contributor Author

anntzer commented Apr 22, 2023

mplcairo does correctly fill the stars in pdf output, and from a quick look (I haven't actually checked the value, just a visual check) gets an alpha closer to the right value in svg.

Copy link

This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!

@github-actions github-actions bot added the status: inactive Marked by the “Stale” Github Action label Jun 19, 2024
@anntzer anntzer added keep Items to be ignored by the “Stale” Github Action and removed status: inactive Marked by the “Stale” Github Action labels Jun 19, 2024
@r3kste r3kste linked a pull request Dec 31, 2024 that will close this issue
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend: pdf backend: svg keep Items to be ignored by the “Stale” Github Action topic: hatch
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants