Colors
It is essential to choose the right color for the plot. If your plot looks good, it will be easy to study it.
Note
If you work with different categories - change colors.
If you work with different values - change colors for them.
Pay attention!
These 2 variants of setting the palette show different color results:
- If you put the palette name with the
.set_palette
function, the colors will be changed for the plot elements; - If you put the palette as an argument in the plot function, colors will be used for the hue variable.
# 1st case
sns.set_palette('mako')
sns.countplot(...)
# 2nd case
sns.countplot(..., palette = 'mako')
To change the brightness and saturation, you can use these default styles:
To visualize the numeric values, we can use perceptually uniform palettes.
Some more palettes!
Here are presented some more matplotlib
colors. You can use them if you're going to set one color for plot elements or customize the plot.
Swipe to start coding
Try to set the palette!
Set the 'mako'
palette for the countplot
.
Рішення
Дякуємо за ваш відгук!
single
Запитати АІ
Запитати АІ
Запитайте про що завгодно або спробуйте одне із запропонованих запитань, щоб почати наш чат
Сумаризуйте цей розділ
Пояснити код у file
Пояснити, чому file не вирішує завдання
Awesome!
Completion rate improved to 4.35
Colors
Свайпніть щоб показати меню
It is essential to choose the right color for the plot. If your plot looks good, it will be easy to study it.
Note
If you work with different categories - change colors.
If you work with different values - change colors for them.
Pay attention!
These 2 variants of setting the palette show different color results:
- If you put the palette name with the
.set_palette
function, the colors will be changed for the plot elements; - If you put the palette as an argument in the plot function, colors will be used for the hue variable.
# 1st case
sns.set_palette('mako')
sns.countplot(...)
# 2nd case
sns.countplot(..., palette = 'mako')
To change the brightness and saturation, you can use these default styles:
To visualize the numeric values, we can use perceptually uniform palettes.
Some more palettes!
Here are presented some more matplotlib
colors. You can use them if you're going to set one color for plot elements or customize the plot.
Swipe to start coding
Try to set the palette!
Set the 'mako'
palette for the countplot
.
Рішення
Дякуємо за ваш відгук!
Awesome!
Completion rate improved to 4.35single