October 2018
Beginner to intermediate
676 pages
18h 30m
English
In this section, we will use the row and col parameters, along with hue, to plot the same data.
Here is the code for this:
day_order = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']sns.relplot(x='Period', y='Smoothies', hue='Promotion', col='daywk', col_wrap=3, col_order=day_order, data=snacks_sales, height=3)sns.relplot(x='Period', y='Smoothies', col='daywk', col_order=day_order, row='Promotion', row_order=['Yes', 'No'], data=snacks_sales, height=3)plt.show();
col_wrap=3 specifies to plot only three columns and after that, wrap it to the next row. When we use this option, we can't use the row parameter.
You should see the following figure on your screen:
Similar to hue_order and style_order ...
Read now
Unlock full access