LoginSignup
58
57

More than 5 years have passed since last update.

Jupyterのレイアウトを変える方法

Last updated at Posted at 2017-08-28

必要なライブラリーをインストールする

pipコマンドを使いjupyterthemesをインストールします。

terminal
$ pip install jupyterthemes

テーマのリストを表示

下記のコマンドでどのテーマが含まれているか表示されます。

terminal
$ jt -l
Available Themes: 
   chesterish
   grade3
   monokai
   oceans16
   onedork
   solarizedd
   solarizedl

テーマの設定

テーマを使うときのコマンドは下記です。オプションについては-Tがツールボックスをつけるというオプションです。-Nはノートブックの名前を出すというオプションです。テーマを反映させるにはJupyter notebookを再起動する必要があります。

terminal
$ jt -t chesterish -T -N

ヘルプを見る場合

テーマを使うときのコマンドは下記です。オプションについては-Tがツールボックスをつけるというオプションです。-Nはノートブックの名前を出すというオプションです。

terminal
$ jt -h
usage: jt [-h] [-l] [-t THEME] [-f MONOFONT] [-fs MONOSIZE] [-nf NBFONT]
          [-nfs NBFONTSIZE] [-tf TCFONT] [-tfs TCFONTSIZE] [-dfs DFFONTSIZE]
          [-ofs OUTFONTSIZE] [-m MARGINS] [-cursw CURSORWIDTH]
          [-cursc CURSORCOLOR] [-cellw CELLWIDTH] [-lineh LINEHEIGHT] [-altp]
          [-altmd] [-P] [-T] [-N] [-vim] [-r] [-dfonts]

optional arguments:
  -h, --help            show this help message and exit
  -l, --list            list available themes
  -t THEME, --theme THEME
                        theme name to install
  -f MONOFONT, --monofont MONOFONT
                        monospace code font
  -fs MONOSIZE, --monosize MONOSIZE
                        code font-size
  -nf NBFONT, --nbfont NBFONT
                        notebook font
  -nfs NBFONTSIZE, --nbfontsize NBFONTSIZE
                        notebook fontsize
  -tf TCFONT, --tcfont TCFONT
                        txtcell font
  -tfs TCFONTSIZE, --tcfontsize TCFONTSIZE
                        txtcell fontsize
  -dfs DFFONTSIZE, --dffontsize DFFONTSIZE
                        pandas dataframe fontsize
  -ofs OUTFONTSIZE, --outfontsize OUTFONTSIZE
                        output area fontsize
  -m MARGINS, --margins MARGINS
                        fix margins of main intro page
  -cursw CURSORWIDTH, --cursorwidth CURSORWIDTH
                        set cursorwidth (px)
  -cursc CURSORCOLOR, --cursorcolor CURSORCOLOR
                        cursor color (r, b, g, p)
  -cellw CELLWIDTH, --cellwidth CELLWIDTH
                        set cell width (px)
  -lineh LINEHEIGHT, --lineheight LINEHEIGHT
                        code/text line-height (%)
  -altp, --altprompt    alt input prompt style
  -altmd, --altmarkdown
                        alt markdown cell style
  -P, --hideprompt      hide cell input prompt
  -T, --toolbar         make toolbar visible
  -N, --nbname          nb name/logo visible
  -vim, --vimext        toggle styles for vim
  -r, --reset           reset to default theme
  -dfonts, --defaultfonts
                        force fonts to browser default

各テーマの紹介

各テーマがどのようなレイアウトか紹介します。

chesterish

terminal
$ jt -t chesterish -T -N

スクリーンショット 2017-08-29 6.20.45.png

grade3

terminal
$ jt -t grade3 -T -N

スクリーンショット 2017-08-29 6.36.35.png

monokai

terminal
$ jt -t monokai -T -N

スクリーンショット 2017-08-29 6.38.01.png

oceans16

terminal
$ jt -t oceans16 -T -N

スクリーンショット 2017-08-29 6.39.05.png

onedork

terminal
$ jt -t onedork -T -N

スクリーンショット 2017-08-29 6.40.21.png

solarizedd

terminal
$ jt -t solarizedd -T -N

スクリーンショット 2017-08-29 6.41.20.png

solarizedl

terminal
$ jt -t solarizedl -T -N

スクリーンショット 2017-08-29 6.42.17.png

58
57
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
58
57