вторник, 9 мая 2023 г.

Цветовые палитры в seaborn

В seaborn реализована поддержка цветовых палитр. Доступ к ним получают методом color_palette() (англ. «цветовая палитра»): 
current_palette = sns.color_palette('coolwarm', 20)
print(sns.palplot(current_palette)) 

Документация Choosing color palettes 

https://seaborn.pydata.org/generated/seaborn.set_theme.html
Set aspects of the visual theme for all matplotlib and seaborn plots. By default, seaborn plots will be made with the current values of the matplotlib rcParams. Calling this function with no arguments will activate seaborn’s “default” theme.
https://seaborn.pydata.org/generated/seaborn.axes_style.html
Get the parameters that control the general style of the plots. Calling with no arguments will return the current defaults for the style parameters. Calling with the name of a predefined style will show those parameter values. Use the function as a context manager to temporarily change the style of your plots.
https://seaborn.pydata.org/generated/seaborn.set_style.html
Set the parameters that control the general style of the plots. Call the function with the name of a seaborn style to set the default for all plots. You can also selectively override seaborn’s default parameter values.
Стиль графика задают методом set_style(). Существует пять разных тем: 'darkgrid' — тёмная сетка; 'whitegrid' — белая сетка; 'dark' — тёмный; 'white' — белый; 'ticks' — штриховка. По умолчанию установлена тема 'darkgrid'. Если вам не нужна сетка на графике, подключите тему 'dark', 'white' или 'ticks'. 

https://seaborn.pydata.org/generated/seaborn.plotting_context.html - Get the parameters that control the scaling of plot elements. etc.

Комментариев нет:

Отправить комментарий