jupyter notebook更換皮膚主題的實現(xiàn)
jupyter notebook更換皮膚主題
視頻地址:https://www.bilibili.com/video/BV1Et4y1D7ru/
您是否厭倦了jupyter notebook的默認主題呢?
您是否想過能不能讓jupyter notebook的界面更加高大上一點呢?
您是否想一天換一個jupyter notebook的主題呢?

有了jupyterthemes,我可以!

下載jupyterthemes
我們可以通過pip來安裝jupyterthemes
pip install jupyterthemes
也可以通過下列命令來更新jupyterthemes到最新版本
pip install --upgrade jupyterthemes
使用jupyterthemes
那么下載完成后,我們可以在終端使用 jupyter-theme 命令來更改notebook主題
jupyter-theme -h # 查看jupyter-theme的幫助手冊
您也可以通過 jupyter-theme 的命令簡寫 jt 來使用
jt -h # 查看jupyter-theme的幫助手冊
強烈推薦第二種方式,因為懶惰是程序員的基本美德
jupyter-theme參數(shù)詳解
| 功能介紹 | 選項參數(shù) | 默認值 |
|---|---|---|
| 查看幫助文檔 | -h | -- |
| 展示所有的皮膚主題 | -l | -- |
| 設(shè)置安裝的主題 | -t | -- |
| 設(shè)置代碼字體樣式 | -f | -- |
| 設(shè)置代碼字體大小 | -fs | 11 |
| 設(shè)置notebook的字體樣式 | -nf | -- |
| 設(shè)置notebook的字體大小 | -nfs | 13 |
| 設(shè)置text/md的cell字體樣式 | -tf | -- |
| 設(shè)置text/md的cell字體大小 | -tfs | 13 |
| 設(shè)置Pandas的DataFrame字體大小 | -dfs | 9 |
| 設(shè)置輸出區(qū)域的字體大小 | -ofs | 8.5 |
| 設(shè)置Mathjax的字體大小(%) | -mathfs | 100 |
| 設(shè)置頁面的margin外邊距 | -m | auto |
| 設(shè)置Cell的寬度 | -cellw | 980 |
| 設(shè)置行高 | -lineh | 170 |
| 設(shè)置光標的寬度 | -cursw | 2 |
| 設(shè)置光標的顏色 | -cursc | -- |
| Alt Prompt Layout | -altp | -- |
| Alt Markdown BG Color | -altmd | -- |
| Alt Output BG Color | -altout | -- |
| Style Vim NBExt* | -vim | -- |
| Toolbar是否可見 | -T | -- |
| 文件名和Logo是否可見 | -N | -- |
| 內(nèi)核的Logo是否可見 | -kl | -- |
| 重置為默認的notebook主題 | -r | -- |
| 重置為默認的字體 | -dfonts | -- |
code cells的可選字體樣式
| -f arg | Monospace Font |
|---|---|
| anka | Anka/Coder |
| anonymous | Anonymous Pro |
| aurulent | Aurulent Sans Mono |
| bitstream | Bitstream Vera Sans Mono |
| bpmono | BPmono |
| code | Code New Roman |
| consolamono | Consolamono |
| cousine | Cousine |
| dejavu | DejaVu Sans Mono |
| droidmono | Droid Sans Mono |
| fira | Fira Mono |
| firacode | Fira Code |
| generic | Generic Mono |
| hack | Hack |
| hasklig | Hasklig |
| inconsolata | Inconsolata-g |
| inputmono | Input Mono |
| iosevka | Iosevka |
| liberation | Liberation Mono |
| meslo | Meslo |
| office | Office Code Pro |
| oxygen | Oxygen Mono |
| roboto | Roboto Mono |
| saxmono | saxMono |
| source | Source Code Pro |
| sourcemed | Source Code Pro Medium |
| ptmono | PT Mono |
| ubuntu | Ubuntu Mono |
notebook與text/md cells的可選字體樣式
Sans-Serif Fonts
| -nf/-tf arg | Sans-Serif Font |
|---|---|
| opensans | Open Sans |
| droidsans | Droid Sans |
| exosans | Exo_2 |
| latosans | Lato |
| ptsans | PT Sans |
| robotosans | Roboto |
| sourcesans | Source Sans Pro |
Serif Fonts
| -nf/-tf arg | Serif Font |
|---|---|
| loraserif | Lora |
| ptserif | PT Serif |
| georgiaserif | Georgia |
| cardoserif | Cardo |
| crimsonserif | Crimson Text |
| ebserif | EB Garamond |
| merriserif | Merriweather |
| neutonserif | Neuton |
| goudyserif | Sorts Mill Goudy |
jupyter-theme使用示例
# 查看所有可選主題 # chesterish | grade3 | gruvboxd | gruvboxl | monokai | oceans16 | onedork | solarizedd | solarizedl jt -l # 切換使用grade3主題 # 一般刷新notebook頁面就可以看到效果,如果沒起作用的話,可能需要刪除一下瀏覽器的緩存 jt -t grade3 # 重置notebook的主題,回到解放前 jt -r # 默認展示工具箱以及文件名 jt -t monokai -T -N # 設(shè)置notebook界面和text/md cells的字體樣式,并且設(shè)置字體大小 # 字體大小的單位為pt jt -t oceans16 -tf merriserif -tfs 10 -nf ptsans -nfs 13 # 設(shè)置cell的寬度與行高 # 可以通過百分比來設(shè)置寬度 jt -t chesterish -cellw 90% -lineh 170 # 通過像素px來設(shè)置cell的寬度,設(shè)置為860px jt -t solarizedd -cellw 860 # 設(shè)置光標變成紅色,并且將其大小變?yōu)?px # 可選的顏色 b (blue), o (orange), r (red), p (purple), g (green), x (font color) jt -t solarizedl -cursc r -cursw 5
jupyter-theme可用主題一覽
默認主題

chesterish

grade3

gruvboxd

gruvboxl

monokai

oceans16

onedork

solarizedd

solarizedl

到此這篇關(guān)于jupyter notebook更換皮膚主題的實現(xiàn)的文章就介紹到這了,更多相關(guān)jupyter notebook更換皮膚內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
- jupyter notebook引用from pyecharts.charts import Bar運行報錯
- Ubuntu安裝Jupyter Notebook教程
- 使用pyecharts在jupyter notebook上繪圖
- Windows下的Jupyter Notebook 安裝與自定義啟動(圖文詳解)
- jupyternotebook 撤銷刪除的操作方式
- JupyterNotebook設(shè)置Python環(huán)境的方法步驟
- TensorFlow安裝及jupyter notebook配置方法
- jupyter notebook讀取/導(dǎo)出文件/圖片實例
- jupyter 實現(xiàn)notebook中顯示完整的行和列
- Jupyter Notebook打開任意文件夾操作
相關(guān)文章
TensorFlow實現(xiàn)卷積神經(jīng)網(wǎng)絡(luò)
這篇文章主要為大家詳細介紹了TensorFlow實現(xiàn)卷積神經(jīng)網(wǎng)絡(luò),具有一定的參考價值,感興趣的小伙伴們可以參考一下2018-05-05
python由已知數(shù)組快速生成新數(shù)組的方法
這篇文章主要介紹了python由已知數(shù)組快速生成新數(shù)組的方法,文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友們下面隨著小編來一起學習學習吧2020-04-04
Python編寫可視化界面的詳細教程(Python+PyCharm+PyQt)
最近開始學習Python,但只限于看理論,編幾行代碼,覺得沒有意思,就想能不能用Python編寫可視化的界面,遂查找了相關(guān)資料,發(fā)現(xiàn)了PyQt,所以本文介紹了Python+PyCharm+PyQt編寫可視化界面的詳細教程,需要的朋友可以參考下2024-07-07
PyTorch中Tensor的數(shù)據(jù)類型和運算的使用
這篇文章主要介紹了PyTorch中Tensor的數(shù)據(jù)類型和運算的使用,文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友們下面隨著小編來一起學習學習吧2020-09-09
Python(Django)項目與Apache的管理交互的方法
這篇文章主要介紹了Python(Django)項目與Apache的管理交互的方法,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧2018-05-05

