Skip to content

Commit 23604bf

Browse files
committedMay 3, 2023
Resolves #35.
1 parent ed39bc0 commit 23604bf

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed
 

‎src/napari_matplotlib/base.py

+5-10
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,7 +48,7 @@ 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")
5453
self.toolbar = NapariNavigationToolbar(self.canvas, self)
5554
self._replace_toolbar_icons()
@@ -126,16 +125,12 @@ def draw(self) -> None:
126125
"""
127126

128127
def apply_napari_colorscheme(self):
129-
"""
130-
Apply napari-compatible colorscheme to the axes object.
131-
"""
128+
"""Apply napari-compatible colorscheme to the axes object."""
132129
if self.axes is None:
133130
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)
131+
# changing color of axes background to transparent
132+
self.canvas.figure.patch.set_facecolor("none")
133+
self.axes.set_facecolor("none")
139134

140135
# changing colors of all axes
141136
[

0 commit comments

Comments
 (0)
Please sign in to comment.