Skip to content
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

dpi was being set to 72 irrespective of what was supplied #20

Closed
wants to merge 4 commits into from
Closed

dpi was being set to 72 irrespective of what was supplied #20

wants to merge 4 commits into from

Conversation

pharshalp
Copy link

@pharshalp pharshalp commented Jan 16, 2020

closes #19 (I think)

And (possibly) gets rid of "Invalid dpi manipulations in vector output." mentioned in https://github.com/matplotlib/mplcairo/blob/master/ISSUES.rst

My apologies in advance if I am trivializing the issue but this just feels like an inadvertent oversight.

@anntzer
Copy link
Collaborator

anntzer commented Jan 16, 2020

I haven't checked locally, but at least CI doesn't seem to be agreeing with you... (you can run the tests locally with run-mpl-test-suite.py; if the fix is correct you should be able to remove the excluded tests from the hardcoded list in that file.

@pharshalp
Copy link
Author

I realized that whatever I have done in this PR is not correct for sure. I am going to spend some time on this over the weekend... looks like I will have to dig into mpl code to figure out all the magic you described

The main problem I am aware of is with using figimage() (so "per-pixel data") with pdf output (where the notion of "pixel" is not really well defined, but conventionally thought of as 72 dpi); I think there's somewhere where I may forget to switch the canvas from 100 dpi (or whatever the "nominal" resolution is) to the pdf output's 72 dpi, or where mpl does it and I do it too so it happens twice (IIRC (from very long time ago...) mpl's image.py code basically does something slightly weird to match the just as undocumented behavior of backend_pdf.py, and I gave up reverse-engineering that).

@anntzer anntzer force-pushed the master branch 7 times, most recently from d9a67c2 to 90bdca6 Compare April 2, 2021 12:25
@anntzer anntzer force-pushed the master branch 3 times, most recently from 7aa2de7 to 842fb24 Compare September 16, 2021 09:04
@anntzer anntzer force-pushed the master branch 7 times, most recently from 45bd634 to 163a369 Compare October 1, 2021 07:46
@anntzer anntzer force-pushed the master branch 8 times, most recently from 8d18fbe to 5618fa6 Compare October 5, 2021 16:29
@anntzer anntzer force-pushed the master branch 2 times, most recently from 486eb87 to d3b6f25 Compare November 4, 2021 14:48
@anntzer anntzer deleted the branch matplotlib:master November 8, 2021 11:02
@anntzer anntzer closed this Nov 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

workaround for low dpi when rasterizing (pcolormesh saved as pdf)
2 participants