Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit cc3ec93

Browse filesBrowse files
committed
Resolves #35.
1 parent ed39bc0 commit cc3ec93
Copy full SHA for cc3ec93

File tree

1 file changed

+6
-10
lines changed
Filter options

1 file changed

+6
-10
lines changed

‎src/napari_matplotlib/base.py

Copy file name to clipboardExpand all lines: src/napari_matplotlib/base.py
+6-10Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
# Icons modified from
1616
# https://github.com/matplotlib/matplotlib/tree/main/lib/matplotlib/mpl-data/images
1717
ICON_ROOT = Path(__file__).parent / "icons"
18-
NAPARI_WINDOW_COLOR = "#262930"
1918
__all__ = ["NapariMPLWidget"]
2019

2120

@@ -49,8 +48,9 @@ def __init__(self, napari_viewer: napari.viewer.Viewer):
4948
self.viewer = napari_viewer
5049
self.canvas = FigureCanvas()
5150

52-
self.canvas.figure.patch.set_facecolor(NAPARI_WINDOW_COLOR)
51+
self.canvas.figure.patch.set_facecolor("none")
5352
self.canvas.figure.set_layout_engine("constrained")
53+
self.canvas.figure.patch.set_facecolor("none")
5454
self.toolbar = NapariNavigationToolbar(self.canvas, self)
5555
self._replace_toolbar_icons()
5656

@@ -126,16 +126,12 @@ def draw(self) -> None:
126126
"""
127127

128128
def apply_napari_colorscheme(self):
129-
"""
130-
Apply napari-compatible colorscheme to the axes object.
131-
"""
129+
"""Apply napari-compatible colorscheme to the axes object."""
132130
if self.axes is None:
133131
return
134-
# changing color of axes background to napari main window color
135-
self.canvas.figure.patch.set_facecolor(NAPARI_WINDOW_COLOR)
136-
137-
# changing color of plot background to napari main window color
138-
self.axes.set_facecolor(NAPARI_WINDOW_COLOR)
132+
# changing color of axes background to transparent
133+
self.canvas.figure.patch.set_facecolor("none")
134+
self.axes.set_facecolor("none")
139135

140136
# changing colors of all axes
141137
[

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.