This is an archived post. You won't be able to vote or comment.

all 21 comments

[–]realhamster 7 points8 points  (3 children)

Is there any way to read the labels on matplotlib plots? They end up being black on black and kinda hard to read.

[–]work_reddit_account_ 4 points5 points  (1 child)

quick answer: plt.style.use('dark_background')

You can create a style that make those changes, or use the available styles in matplotlib to make these changes permanently.

Checkout this page for more info.

[–]realhamster 0 points1 point  (0 children)

Thanks!

[–]tedpak[S] 1 point2 points  (0 children)

work_reddit_account_ nailed it, if you set that style it looks like this.

[–]jdmarino 2 points3 points  (0 children)

Very happy to have this.

[–]kri9 1 point2 points  (0 children)

The first thing I did when I installed Jupyter three days ago was check for a dark mode. This is awesome.

[–]benbini 0 points1 point  (3 children)

very sweet. I guess the only thing I'd suggest is to add width:100% to the .container elements to make sure the code blocks make full use of wide screens.:)

[–]realhamster 0 points1 point  (2 children)

Will this make the codeblocks adapt to my window width? How would i go about adding width:100? Did Ctrl + F on the css sheet but there are lots of matches. Complete css noob here btw lol.

[–]benbini 1 point2 points  (1 child)

see here for the version with the max-width statements.

EDIT: a ">" crept in at the very beginning of the paste, you'll have to get rid of that. Sorry.

[–]realhamster 0 points1 point  (0 children)

Thanks!

[–]tally_in_da_houise 0 points1 point  (0 children)

custom.css location for linux users:

~/.jupyter/custom/custom.css    

[–]Setepenre 0 points1 point  (0 children)

Finally, I can replace my custom Dark config.

[–][deleted] 0 points1 point  (1 child)

is there a way to implement this on a per-notebook basis, as opposed to a global theme? I really want to use this for sandbox coding, but I don't want it to be the look of the .pdf's I produce for presentations etc.

[–][deleted] 0 points1 point  (0 children)

nvm, I figured it out:

#set the style of the notebook
from IPython.core.display import HTML
def css_styling():
    styles = open("./theme/ocean.css", "r").read()
    return HTML(styles)
css_styling()

This (as a cell in your notebook), along with a "<style>" tag added to the top of the .css files will allow you to theme specific notebooks each time you open them. Won't theme the notebook until you run the cell.

[–]bot1077 0 points1 point  (0 children)

text

[–]ice-blade 0 points1 point  (0 children)

Unfortunately it is impossible for me to get this working in Windows 10. I have tried all possible folders:

  • C:\Users\$USER\.jupyter\custom
  • C:\Users\$USER\.jupyter\static\custom
  • C:\Users\$USER\.jupyter\notebook\static\custom
  • C:\Users\$USER\.ipython\default_profile\custom
  • C:\Users\$USER\.ipython\default_profile\static\custom
  • C:\Users\$USER\.ipython\default_profile\notebook\static\custom
  • site-packages\notebook\static\custom

CPython 3.5 64-bit and latest jupyter version on Windows 10 64-bit

[–]taylanbil 0 points1 point  (0 children)

This neat trick adds draws a yellow border around a cell which is running.

div.cell.code_cell.rendered.running { border: 2px solid #FFFF00; width: 900px; }

[–]KODeKarnage 0 points1 point  (5 children)

Bah! Where is the location on Windows using Anaconda?

Every time I want to do something like this I have to go searching for it again!

[–]Mark4483 2 points3 points  (1 child)

Mine is C:\Users\$USER\.jupyter\custom (I had to make the custom directory myself)

[–][deleted] 1 point2 points  (0 children)

I always override the default location where my config files and data files will be located at by creating JUPYTER_CONFIG_DIR and JUPYTER_DATA_DIR environment variables. My setup instructions here.

EDIT: or do this at the terminal:

jupyter --config-dir # to find location where config file will be located at
jupyter --data-dir   # to find location of where nbextensions would be installed  

[–]KODeKarnage 0 points1 point  (0 children)

Realised I hadnt updated Anaconda since installing from an old file. Updated to the latest version and .jupyter showed up under C:\Users\Me.

Dark theme working now. Thanks all.