Skip to content

[Bug]: savefig(..., transparent=True) does not make inset_axes transparent #22674

Closed

Description

@anntzer

Bug summary

All's in the title.

Code for reproduction

from pylab import *
gca().inset_axes([.1, .2, .3, .4]); savefig("/tmp/test.png", transparent=True)

# then display /tmp/test.png with a viewer that distinguishes between white and transparent: the inset axes is not transparent.

Actual outcome

Inset is not transparent.

Expected outcome

Inset is transparent (... well, admittedly I guess whether one wants this or not may be figure-dependent?) (mildly relatedly, see also #10023.)

Additional information

No response

Operating system

arch linux

Matplotlib Version

3.6.0.dev1856+ga2ddfc0c0f

Matplotlib Backend

agg

Python version

310

Jupyter version

ENOSUCHLIB

Installation

git checkout

Activity

  1. QuLogic commented on Mar 22, 2022

    @QuLogic
    Member

    I'm surprised that the regular Axes was made transparent in the first place, but apparently that's what it's supposed to do.

  2. sramesh750 commented on Mar 23, 2022

    @sramesh750
    Contributor

    I could start working on this issue!

  3. timhoffm commented on Mar 23, 2022

    @timhoffm
    Member

    @sramesh750 Go for it!

    transparent=True should make all Axes transparent. Should more special needs arise, we can still add more options like transparent='figure' later, but I would hold that until someone asks for it.

  4. rcomer commented on Feb 25, 2023

    @rcomer
    Member

    Closed by #24816 I think.

  5. added this to the v3.8.0 milestone on Feb 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions