|
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,7 +48,7 @@ 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")
|
54 | 53 | self.toolbar = NapariNavigationToolbar(self.canvas, self)
|
55 | 54 | self._replace_toolbar_icons()
|
@@ -126,16 +125,12 @@ def draw(self) -> None:
|
126 | 125 | """
|
127 | 126 |
|
128 | 127 | 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.""" |
132 | 129 | if self.axes is None:
|
133 | 130 | 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") |
139 | 134 |
|
140 | 135 | # changing colors of all axes
|
141 | 136 | [
|
|
0 commit comments