Skip to content

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

Closed
pharshalp wants to merge 4 commits intomatplotlib:masterfrom
pharshalp:fixdpiissue
Closed

dpi was being set to 72 irrespective of what was supplied#20
pharshalp wants to merge 4 commits intomatplotlib:masterfrom
pharshalp:fixdpiissue

Conversation

@pharshalp
Copy link
Copy Markdown

@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
Copy Markdown
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
Copy Markdown
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 30 times, most recently from 5467832 to 20d4438 Compare August 6, 2020 20:17
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