File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -99,6 +99,21 @@ def _fun(self):
99
99
_Subplot .is_last_row = _fun
100
100
101
101
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
+
102
117
#%% Warning handling
103
118
import warnings
104
119
warnings .filterwarnings ("ignore" , category = UserWarning )
You can’t perform that action at this time.
0 commit comments