Skip to content

Remove the magic background colour. #84

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
May 4, 2023

Conversation

samcunliffe
Copy link
Collaborator

Solves #35

@samcunliffe samcunliffe marked this pull request as draft May 3, 2023 16:51
@samcunliffe samcunliffe force-pushed the 35-background-transparent branch from 9419be5 to cc3ec93 Compare May 3, 2023 17:36
@samcunliffe samcunliffe force-pushed the 35-background-transparent branch from cc3ec93 to 23604bf Compare May 3, 2023 17:41
@samcunliffe samcunliffe requested review from dstansby and ruaridhg May 3, 2023 17:51
@samcunliffe samcunliffe linked an issue May 3, 2023 that may be closed by this pull request
@samcunliffe samcunliffe marked this pull request as ready for review May 3, 2023 17:52
self.axes.set_facecolor(NAPARI_WINDOW_COLOR)
# changing color of axes background to transparent
self.canvas.figure.patch.set_facecolor("none")
self.axes.set_facecolor("none")

# changing colors of all axes
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bit of a napari noob here, but I'd guess that these lines 👇 don't work with light themes.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ooh yes, suppose they will not. I hadn't heard of the light theme before, I will open a new issue to test and possibly fix napari-matplotlib with the white theme.

Copy link
Member

@dstansby dstansby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 LGTM, with the napari light theme selected the Matplotlib figure (looks awful but) has a transparent background.

@dstansby dstansby added this pull request to the merge queue May 4, 2023
Merged via the queue into matplotlib:main with commit b656cba May 4, 2023
@samcunliffe samcunliffe deleted the 35-background-transparent branch May 4, 2023 08:17
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make figure background colour transparent
2 participants