Making your visualizations efficient

Improving Your Data Visualizations in Python

Nick Strayer

Instructor

What is efficient?

  • Reduce the effort needed to see story
  • Re-organize plots to keep focus
  • Improve 'ink' to info ratio
  • Don't compromise the message

Chaotic line simplified over multiple steps to a straight line

Improving Your Data Visualizations in Python

An abstract report with three separate plots on the left with arrow point to right showing the same three plots grouped together at the top of the report

Improving Your Data Visualizations in Python
# 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)

A line plot of pollution values over various years next to a bar plot of the number of observations for each year

Improving Your Data Visualizations in Python

Clear unnecessary legends

A line plot of pollution values over various years next to a bar plot of the number of observations for each year pointing out that bar plot could be used as legend for line chart

Improving Your Data Visualizations in Python
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()

A line plot of pollution values over various years next to a bar plot of the number of observations where colors of bar plots bars serve as a legend for line chart

Improving Your Data Visualizations in Python

Let's practice

Improving Your Data Visualizations in Python

Preparing Video For Download...