我喜欢黑暗题材。但是,Jupyter笔记本的默认主题是浅色,我找不到更改主题/背景色的选项。这是怎么做到的?


当前回答

我的完整解决方案:

1)在chrome上获得黑暗读者,这不仅会让你为Jupyter一个伟大的黑暗主题,而且为每一个你想要的网站(你可以玩不同的过滤器。我使用Dynamic)。

2)将这些代码行粘贴到你的笔记本上,这样图例和轴就可以看到了:

from jupyterthemes import jtplot
jtplot.style(theme='monokai', context='notebook', ticks=True, grid=False)

你已经为迪斯科编码之夜做好了准备!

其他回答

如果有人有兴趣在启用主题的docker中运行anaconda

docker run -t --rm -p 8888:8888 -v $(pwd):/opt/notebooks continuumio/anaconda3 /bin/bash -c "pip install jupyterthemes; jt -t onedork; /opt/conda/bin/jupyter notebook --ip=0.0.0.0 --port=8888 --notebook-dir=/opt/notebooks --allow-root --no-browser;"

您可以使用运行笔记本中的set_nb_theme更改主题

!pip install jupyterthemes

from jupyterthemes import get_themes
import jupyterthemes as jt
from jupyterthemes.stylefx import set_nb_theme

set_nb_theme('chesterish')

从https://www.kaggle.com/getting-started/97540粘贴

你可以按照这些步骤来做。

PIP install jupyterthemes或PIP install——upgrade jupyterthemes以升级到最新版本的主题。 然后列出所有的主题:jt -l 在jt-t <themename>之后,例如jt-t solarizedl

如果在尝试使用PIP时出现错误,您可以使用CMD并运行您的命令。

遵循以下步骤

使用pip安装jupyterthemes:

pip install jupyterthemes

然后从下面选择主题,并使用以下命令设置它们。一旦成功安装,我们中的许多人认为我们需要再次启动jupyter服务器,只需刷新页面。

使用以下命令设置主题:

jt -t <theme-name>

可用的主题:

onedork grade3 oceans16 chesterish monokai solarizedl solarizedd

可用主题的截图在其Github存储库中。

在设置主题时,还可以在同一个命令中指定-T(——toolbar)来保留工具栏,否则工具栏将不显示。如需帮助,请输入jt -h。