我喜欢黑暗题材。但是,Jupyter笔记本的默认主题是浅色,我找不到更改主题/背景色的选项。这是怎么做到的?
当前回答
如前所述,您可以安装使用更广泛的jupyterthemes。 但是,我也可以更喜欢和推荐jupyter-themer,它更容易使用,不影响jupyter笔记本的默认形状。
安装:pip install jupyter-themer
带有文档和示例的存储库(*目前,示例存储在未合并的pull-request中):@github: jupyter-thamer
我最喜欢的定制:jupyter-themer -b dark -c zenburn。
其他回答
简单,Jupyter字体大小和内外背景颜色的全局更改(此更改将影响所有笔记本电脑)。
在Windows下,通过运行命令找到config目录: jupyter——config-dir
在Linux中是~/.jupyter
在此目录中创建子文件夹custom 创建文件custom.css并粘贴:
/* Change outer background and make the notebook take all available width */
.container {
width: 99% !important;
background: #DDC !important;
}
/* Change inner background (CODE) */
div.input_area {
background: #F4F4E2 !important;
font-size: 16px !important;
}
/* Change global font size (CODE) */
.CodeMirror {
font-size: 16px !important;
}
/* Prevent the edit cell highlight box from getting clipped;
* important so that it also works when cell is in edit mode */
div.cell.selected {
border-left-width: 1px !important;
}
最后,重启Jupyter。结果:
conda install jupyterthemes
在Windows系统中不适合我。我用的是水蟒。
但是,
pip install jupyterthemes
在Anaconda Prompt工作过。
您可以使用运行笔记本中的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粘贴
我的完整解决方案:
1)在chrome上获得黑暗读者,这不仅会让你为Jupyter一个伟大的黑暗主题,而且为每一个你想要的网站(你可以玩不同的过滤器。我使用Dynamic)。
2)将这些代码行粘贴到你的笔记本上,这样图例和轴就可以看到了:
from jupyterthemes import jtplot
jtplot.style(theme='monokai', context='notebook', ticks=True, grid=False)
你已经为迪斯科编码之夜做好了准备!
使用FireFox插件“暗黑木星”。
推荐文章
- 强迫自己掌握vi的最好方法是什么?
- 是否有Eclipse行宽标记?
- tqdm在Jupyter笔记本重复打印新的进度条
- 如何知道哪个Python在Jupyter笔记本上运行?
- 使用Python 3在Jupyter Notebook中使用相对导入从位于另一个目录中的模块导入本地函数
- 如何在编辑器(Atom, notepad++, Kate, VIM, Sublime, Textpad等)和ide (NetBeans, IntelliJ IDEA, Eclipse, Visual Studio等)中选择列
- 使用Emacs递归地查找和替换尚未打开的文本文件
- 如何嵌入HTML到IPython输出?
- 如何使Sublime Text成为Git的默认编辑器?
- 禁止在vim中创建交换文件
- 如何从终端运行。ipynb Jupyter Notebook ?
- 移除jupyter笔记本上的内核
- 基于gui或基于web的JSON编辑器,工作方式类似于属性浏览器
- 如何加载/编辑/运行/保存文本文件(.py)到IPython笔记本细胞?
- 如何改变AlertDialog的主题