-1

When using style.use('dark_background') the axis of my graphs will keep the white background, making the axis` labels and tickers not visible (white font over a white background.

If I use any other style instead, the labels will normally show up when plotting.

I'm using Jupyter Notebook.

Any thoughts?

Thank you!

Arthur Coimbra
  • 437
  • 1
  • 6
  • 16
  • The dark_background style [works fine](https://i.stack.imgur.com/J8vV2.png). It will colorize the numbers in white such that they are visible on the black background. See [mcve] for what is needed if you have a problem using it. – ImportanceOfBeingErnest Aug 15 '18 at 10:14

2 Answers2

0

The labels and and axis are still there, they are just black so they blend in with the dark background. You should try modifying the colors of the labels and axis, as per this answer here.

ax.spines['bottom'].set_color('#dddddd')
ax.spines['top'].set_color('#dddddd') 
ax.spines['right'].set_color('red')
ax.spines['left'].set_color('red')
ax.tick_params(axis='x', colors='red')
ax.tick_params(axis='y', colors='red')
ax.yaxis.label.set_color('red')
ax.xaxis.label.set_color('red')
ax.title.set_color('red')
Ethan Rogers
  • 191
  • 6
0

I couldn't diagnose the problem but was able to find a solution.

After making a plot with the described issue, import the package again matplotlib and remake the plot, this should extend the dark background to the axis too, and make them visible.

This problem seems to happen only when using Jupyter Notebook.

Arthur Coimbra
  • 437
  • 1
  • 6
  • 16