Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3d970a1

Browse files
authored
Merge pull request #26 from jo-mueller/make-widget-compliant-with-napari-color-scheme
Make widget compliant with napari color scheme
2 parents 2f5e92a + 010a0fc commit 3d970a1

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/napari_matplotlib/base.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@
33
from matplotlib.figure import Figure
44
from qtpy.QtWidgets import QVBoxLayout, QWidget
55

6+
import matplotlib as mpl
7+
mpl.rc('axes', edgecolor='white')
8+
mpl.rc('axes', facecolor = '#262930')
9+
mpl.rc('axes', labelcolor = 'white')
10+
mpl.rc('savefig', facecolor = '#262930')
11+
mpl.rc('text', color = 'white')
12+
13+
mpl.rc('xtick', color = 'white')
14+
mpl.rc('ytick', color = 'white')
615
__all__ = ["NapariMPLWidget"]
716

817

@@ -31,7 +40,8 @@ def __init__(self, napari_viewer: napari.viewer.Viewer):
3140

3241
self.viewer = napari_viewer
3342
self.figure = Figure(figsize=(5, 3), tight_layout=True)
34-
self.canvas = FigureCanvas(self.figure)
43+
self.canvas = FigureCanvas()
44+
self.canvas.figure.patch.set_facecolor('#262930')
3545
self.toolbar = NavigationToolbar2QT(self.canvas, self)
3646
self.axes = self.canvas.figure.subplots()
3747

0 commit comments

Comments
 (0)