1. Learn
  2. /
  3. Courses
  4. /
  5. Improving Your Data Visualizations in Python

Connected

Exercise

Enhancing legibility

You and your colleagues have decided that the most important aspect of the data you want to show is the differences between the most "market-friendly" state, Vermont, and the least, Texas. To do this, put two plots side by side – a barplot showing the number of people per farmer's market in the state and a scatter plot showing the population on the x-axis and the number of markets on the y-axis.

Emphasize your findings by calling out Vermont and Texas by assigning them distinct colors. Also, provide a large and easy to read annotation for Texas.

Supplied is a vector state_colors that assigns Vermont and Texas unique colors and all other states gray along with the annotation describing Texas, tx_message.

Instructions

100 XP
  • Map the supplied color vector state_colors to the bar plot (ax1) with the palette argument in sns.barplot().
  • Map the color vector to the scatter plot points with the c argument.
  • Make sure annotation text is legible by changing its size to 15.