The seaborn plot is cool. I thought it was annoying to import every time, but I realized that I could use the seaborn style without importing ** seaborn **. (Maybe it's natural?) Of course, you need to have seaborn installed in advance. Make a note of what kind of plot you can make.
The style file is xxx.mplstyle in the folder matplotlib / mpl-data / stylelib. Of course you can also make it yourself. After all, each style has its advantages and disadvantages, so it may be best to make it yourself.
Set black background default line colors to white.
lines.color: white
patch.edgecolor: white
text.color: white
axes.facecolor: black
axes.edgecolor: white
axes.labelcolor: white
axes.prop_cycle: cycler('color', ['8dd3c7', 'feffb3', 'bfbbd9', 'fa8174', '81b1d2', 'fdb462', 'b3de69', 'bc82bd', 'ccebc4', 'ffed6f'])
xtick.color: white
ytick.color: white
grid.color: white
figure.facecolor: black
figure.edgecolor: black
savefig.facecolor: black
savefig.edgecolor: black
It seems good to choose the style you want to base on and play around with it yourself.
Examples
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
def testplot():
x=np.arange(21)
for i in range(2,9):
y=i*0.3*np.sin(np.pi/10*x)
plt.plot(x,y,'o-',label=str(i-1))
plt.legend()
plt.show()
####Plt to put the spell you did here.style.use()####
testplot()
When you don't cast any spells.
plt.style.use('default') For some reason, unlike the default, it's confusing. And the same result as plt.style.use ('classic').
plt.style.use('bmh')
plt.style.use('dark_background')
plt.style.use('fivethirtyeight')
plt.style.use('ggplot')
plt.style.use('grayscale') This is probably the style originally included in matplotlib.
plt.style.use('seaborn-bright')
plt.style.use('seaborn-colorblind')
plt.style.use('seaborn-dark')
plt.style.use('seaborn-dark-palette')
plt.style.use('seaborn-darkgrid')
plt.style.use('seaborn-deep')
plt.style.use('seaborn-muted')
plt.style.use('seaborn-pastel')
plt.style.use('seaborn-ticks') The tick is now facing out.
plt.style.use('seaborn-white') And it's gone.
plt.style.use('seaborn-whitegrid')
plt.style.use('seaborn-colorblind')
plt.style.use('seaborn-whitegrid')
The frame line is gone. I prefer this one. And since the characters etc. become larger according to the size, it seems to be convenient when you want to increase the resolution. If you want to resize, it seems good to declare the resize style first. seaborn-paper<seaborn-notebook<seaborn-talk<seaborn-poster
Please let us know if you have any other recommended styles!
Recommended Posts