Improving Your Data Visualizations in Python
Nick Strayer
Instructor
# Create a subplot w/ one row & two columns. f, (ax1, ax2) = plt.subplots(1, 2)
# Pass each axes to respective plot sns.lineplot('month', 'NO2', 'year', ax=ax1, data=pol_by_month)
sns.barplot('year', 'count', ax=ax2, data=obs_by_year)
sns.lineplot('month', 'NO2', 'year', ax=ax1, data=pol_by_month, palette='RdBu',)
sns.barplot('year', 'count', 'year', ax=ax2, data=obs_by_year, palette='RdBu', dodge=False)
# Remove legends for both plots ax1.legend_.remove() ax2.legend_.remove()
Improving Your Data Visualizations in Python