15
15
# Icons modified from
16
16
# https://github.com/matplotlib/matplotlib/tree/main/lib/matplotlib/mpl-data/images
17
17
ICON_ROOT = Path (__file__ ).parent / "icons"
18
- NAPARI_WINDOW_COLOR = "#262930"
19
18
__all__ = ["NapariMPLWidget" ]
20
19
21
20
@@ -49,8 +48,9 @@ def __init__(self, napari_viewer: napari.viewer.Viewer):
49
48
self .viewer = napari_viewer
50
49
self .canvas = FigureCanvas ()
51
50
52
- self .canvas .figure .patch .set_facecolor (NAPARI_WINDOW_COLOR )
51
+ self .canvas .figure .patch .set_facecolor ("none" )
53
52
self .canvas .figure .set_layout_engine ("constrained" )
53
+ self .canvas .figure .patch .set_facecolor ("none" )
54
54
self .toolbar = NapariNavigationToolbar (self .canvas , self )
55
55
self ._replace_toolbar_icons ()
56
56
@@ -126,16 +126,12 @@ def draw(self) -> None:
126
126
"""
127
127
128
128
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."""
132
130
if self .axes is None :
133
131
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" )
139
135
140
136
# changing colors of all axes
141
137
[
0 commit comments