[PYTHON] Setting to make the scale and label of the figure easy to see even in the dark theme with google Colaboratory

Recommended for people like this

・ People who use dark themes in google colaboratory but are having trouble seeing the scales and labels in the figure.

google colaboratory dark theme

The standard theme is dull, but the dark theme is cool. It's motivating and easy on the eyes even at night. WS000013.JPG

problem

However, there is one drawback. That is, the scales and labels on the figure are crushed. Let's plot 50 randomly random scatter plots.

python


import numpy as np
import matplotlib.pyplot as plt
a = np.random.rand(50)
b = np.random.rand(50)
plt.scatter(a,b)

WS000010.JPG can not see... The reason is that the background of the scale and label part is a transparent image, so it is difficult to see the characters of the same color as the background image.

Solution

Let's add the text below.

python


import seaborn as sns
sns.set()

This is the same

python


plt.scatter(a,b)

Then WS000011.JPG It looked beautiful. If you do not include sns.set (), the label and scale will be transparent images even if you are seaborn, so be careful.

Recommended Posts

Setting to make the scale and label of the figure easy to see even in the dark theme with google Colaboratory
To output a value even in the middle of a cell with Jupyter Notebook
Make it easy to specify the time of AWS CloudWatch Events with CDK.
[Python] Get / edit the scale label of the figure
I tried to make it easy to change the setting of authenticated Proxy on Jupyter
[Implementation explanation] How to use the Japanese version of BERT in Google Colaboratory (PyTorch)
It is easy to execute SQL with Python and output the result in Excel
Add information to the bottom of the figure with Matplotlib
How to load files in Google Drive with Google Colaboratory
Easy learning of 100 language processing knock 2020 with "Google Colaboratory"
Run the Caffe model on Google Colaboratory to predict the age and gender of the world's supermodels
Make a note of what you want to do in the future with Raspberry Pi
[Super easy! ] How to display the contents of dictionaries and lists including Japanese in Python
See the power of speeding up with NumPy and SciPy
When I try to execute the make command of Makefile with os / exec of golang, the second and subsequent executions result in an error.
Easy to make with syntax
Scraping the schedule of Hinatazaka46 and reflecting it in Google Calendar
Make the theme of Pythonista 3 like Monokai (how to make your own theme)
Output the contents of ~ .xlsx in the folder to HTML with Python
Feel free to change the label of the legend in Seaborn in python
Throw something to Kinesis with python and make sure it's in
The strongest way to use MeCab and CaboCha with Google Colab
To improve the reusability and maintainability of workflows created with Luigi
[Rails 6] Embed Google Map in the app and add a marker to the entered address. [Confirmation of details]
How to run the practice code of the book "Creating a profitable AI with Python" on Google Colaboratory
How to copy and paste the contents of a sheet in Google Spreadsheet in JSON format (using Google Colab)