-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
MixedModeRenderer non-72-dpi fixes & Pgf mixed rendering #1975
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
Conversation
@@ -48,6 +48,7 @@ def __init__(self, figure, width, height, dpi, vector_renderer, | |||
# the figure dpi before and after the rasterization. Although | |||
# this looks ugly, I couldn't find a better solution. -JJL | |||
self.figure=figure | |||
self._figdpi = figure.get_dpi() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just spotted this one too.
👍 - looks good to me. |
Ok, this looks VERY related to the PR you mentioned. You think this will be beneficial or does it interfere with the other patch? |
This PR fixes a bug which #1185 does not. Namely: The figure dpi is reverted to 72 after using the MixedModeRasterizer. After that, there is an awful lot of overlap. I suggest that we focus on #1185 (with a keen eye from yourself) and once that is in, we look at implementing this fix. How does that sound? |
Just looking through the code, I don't think it will interfere with #1185 (or other backends). The hard-coded dpi of 72 was because all the vector backend uses dpi of 72 internally. But, this seems not to be the case of pgf backend. While the PR looks good to me, I will try some test sometime this weekends. |
@leejjoon The test I included looks the same for backend_pdf and backend_pgf. |
Rebased on new master, but a test for py2.6 failed, don't know if that is related to my PR. I can check that tomorrow. |
MixedModeRenderer non-72-dpi fixes & Pgf mixed rendering
Allright, the 2.6 test fail is not related to this PR, merging... |
py2.6 now passes, but py3.3 throws an |
MixedModeRenderer non-72-dpi fixes & Pgf mixed rendering
I would like to add mixed mode rendering + test to
backend_pgf
for handling plots that are too complex for vectorized output (https://github.com/pwuertz/matplotlib-backend-pgf/issues/5).A small fix was necessary since MixedModeRenderer assumes that the figure's dpi is always 72. I think I also fixed a bad indent at
stop_rasterizing
that was probably unnoticeable due to the fixed dpi assumption. According to a comment in the code @leejjoon might know if this is correct.