Skip to content

Commit 49c98b0

Browse files
committed
Update __init__.py
1 parent 3f160e3 commit 49c98b0

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

__init__.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,21 @@ def _fun(self):
9999
_Subplot.is_last_row=_fun
100100

101101

102+
#%% Dark mode
103+
if 'google.colab' in sys.modules:
104+
from google.colab import output
105+
is_dark = output.eval_js('document.documentElement.matches("[theme=dark]")')
106+
if is_dark:
107+
import matplotlib.pyplot as _plt
108+
x=56
109+
_plt.rcParams["figure.facecolor"]=(x/256,x/256,x/256)
110+
_plt.rcParams["axes.facecolor"]=(x/256,x/256,x/256)
111+
_plt.rcParams["axes.edgecolor"]=(1,1,1)
112+
_plt.rcParams["axes.labelcolor"]=(1,1,1)
113+
_plt.rcParams["xtick.color"]=(1,1,1)
114+
_plt.rcParams["ytick.color"]=(1,1,1)
115+
_plt.rcParams["text.color"]=(1,1,1)
116+
102117
#%% Warning handling
103118
import warnings
104119
warnings.filterwarnings("ignore", category=UserWarning)

0 commit comments

Comments
 (0)