-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
DOC: better document rcParams in savefig.* grouping #9030
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
Comments
Related issue: #2384 |
I am happy to work on a PR if this has a chance of being accepted. |
The facecolor can be an RGBA value so setting mpl.rcParams['figure.facecolor'] = (0, 0, 0, 0) should do what you want? |
Hi Thomas, I tried this, but full RGBA values are not supported in matplotlibrc. When I set this
I get this error:
|
So perhaps the more general solution is to allow full RGBA colors in matplotlibrc. |
Update: It also turns out the following code does not work as expected:
Opening testme.png shows a white background, not a transparent background for the figure patch. I think that is a bug. The following works:
|
To me it looks like the figure is transparent but the axis is not. That is what I would expect when you set the figure transparent and the axes facecolor has its default value which is white.
to do the trick |
Hi Jens, yes, I had the same expectation from my naive point of view. And just to clarify: the attached picture (testme2.png) is the desired outcome that I want. |
Hi Jens, sorry, I was not reading closely enough what you wrote.
does not work either, it produces just a white figure background and a white axes background. Also, I don't want the axes background to be transparent, only the figure background. |
Ok I assumed that the attached image was the broken behaviour |
@anntzer Thanks for the related PR :). I take whatever works, but I think that setting |
Hmm, we change There is also |
@tacaswell I read about |
@anntzer I can confirm that this code
produces exactly what I want. Thanks! 😄 Following your advice as I understood it, I tried to add this line to my matplotlibrc:
But I then get this error:
|
Okay, looking into the relevant code myself helps ;)
Note that one has to omit the |
Ok, nevermind, the |
This is fantastic. Thanks everyone! |
Feature request
Feature summary
The FAQ https://matplotlib.org/faq/howto_faq.html describes a way to make the figure patch transparent, see "Save transparent figures". It would be great to have an option for the matplotlibrc file to always make the figure patch transparent.
Code
As described in the FAQ, the following code makes the figure patch transparent.
I am aware of the rcParams option "savefig.transparent" which makes the figure patch and the axis patch transparent. I only want the figure patch to be transparent, because this looks very nice on slides with a gradient on the background.
Matplotlib version
The text was updated successfully, but these errors were encountered: