Exporting figure as pdf using savefig() messes up axis background in OS X#1894
Conversation
|
Seems to be unrelated to macosx (which isn't used to produce PDFs). Looking into it now. |
|
Can you confirm that the attached patch resolves your issue? |
|
Thanks for the clarification on the backend. I'll test this tomorrow and let you know. |
src/_image.cpp
Outdated
There was a problem hiding this comment.
This is fine by me, but I wonder why we need to set the RGB to 1? Is there a similar solution here to the one proposed in #1868?
There was a problem hiding this comment.
Yeah -- at the end of the day, it doesn't matter, but maybe it does make sense to be consistent with #1868. I'll fix this up.
|
👍 LGTM. |
|
👍 This commit resolves my issue. Thanks for the prompt fix! Note: I can't believe compilation on OS X is so simple these days. I used to patch make.osx before I could do anything, which generally meant looking for the latest links to the dependencies. I guess |
|
Apologies, closed by mistake. I'm assuming you'll close this issue when merging the pull request. |
Yep. @mdboom - I wonder if it is worth having some alpha in the axis background, just to test that it is working. I also wonder whether we should use some colour in the actual images being drawn, perhaps simply |
|
@pelson: Good suggestions. Done. |
Fixes background coloring of multiple images on the same axes.
Cool. Don't forget to cite us: http://matplotlib.org/citing.html 😉 |
|
Will not! ✌️ |
I'm trying to change the axis background on a plot where several imshow() calls render images in various locations via the extent parameter.
When I save a pdf of the figure using savefig(), I lose the background color if the axis displays more than one image. Note that this doesn't happen when exporting a png of the same figure.
Example code and the corresponding output [stackoverflow.com].
Could this be a bug with the MacOSX backend I'm using?
Note: I'm using matplotlib 1.2.1 installed via
piprunning on Python 2.7.4