Sposób set_style()
może argumentu stylu (np 'white'
, 'whitegrid'
, 'darkgrid'
, etc.) i dict parametrów, aby zastąpić domyślne estetyczne, w tym, czy ma ramę legendę lub nie.
Jeśli masz inne małe rzeczy do stylizacji, które chciałbyś zmienić, a które często robię, możesz ustawić je wszystkie naraz.
import seaborn
seaborn.set_style('darkgrid', {'legend.frameon':True})
Zgodnie the docs, można uzyskać seaborn
„s obecne rc
ustawienia z seaborn.axes_style()
{'axes.axisbelow': True,
'axes.edgecolor': '.8',
'axes.facecolor': 'white',
'axes.grid': True,
'axes.labelcolor': '.15',
'axes.linewidth': 1.0,
'figure.facecolor': 'white',
'font.family': [u'sans-serif'],
'font.sans-serif': [u'Arial',
u'DejaVu Sans',
u'Liberation Sans',
u'Bitstream Vera Sans',
u'sans-serif'],
'grid.color': '.8',
'grid.linestyle': u'-',
'image.cmap': u'rocket',
'legend.frameon': False,
'legend.numpoints': 1,
'legend.scatterpoints': 1,
'lines.solid_capstyle': u'round',
'text.color': '.15',
'xtick.color': '.15',
'xtick.direction': u'out',
'xtick.major.size': 0.0,
'xtick.minor.size': 0.0,
'ytick.color': '.15',
'ytick.direction': u'out',
'ytick.major.size': 0.0,
'ytick.minor.size': 0.0}
patrz metoda' add_legend': https://github.com/mwaskom/seaborn/blob/master/ seaborn/axgrid.py – xecafe
Nie jestem pewien jak to mi pomoże - nie mam 'seaborn.axisgrid.Grid', a osie nie mają metody' add_legend'. – mathause