The power of hue

Python for Spreadsheet Users

Chris Cardillo

Data Scientist

Our nice barplot

The Plot

Revenue by Store Final.png

The Data Behind the Plot

The Data that Powers the basic plot.png

Python for Spreadsheet Users

A more granular barplot

The Data Behind the New Plot

by fruit store sorted by store and name.png

Python for Spreadsheet Users

A more granular barplot

The Data Behind the New Plot

by fruit store sorted by store and name.png

The New Plot

Revenue by Store - Fruit Breakdown.png

Python for Spreadsheet Users

Hue

sns.barplot(x='store',
            y='revenue',
            data=fruit_store_summary,
            hue='product_name')

Revenue by Store - Fruit Breakdown.png

Python for Spreadsheet Users

plt.legend()

sns.barplot(x='store',
            y='revenue',
            data=fruit_store_summary,
            hue='product_name')

plt.legend(bbox_to_anchor=(1, 1))

Revenue by Store - Fruit Breakdown.png

Python for Spreadsheet Users

All together

sns.set_style('whitegrid')

sns.barplot(x='store',
            y='revenue',
            data=fruit_store_summary,
            hue='product_name')

plt.legend(bbox_to_anchor=(1, 1))

plt.title('Revenue by Store - Fruit Breakdown')
plt.xlabel('Store')
plt.ylabel('Revenue (USD)')
sns.despine()
plt.show()

Revenue by Store - Fruit Breakdown.png

Python for Spreadsheet Users

Your turn!

Python for Spreadsheet Users

Preparing Video For Download...