1. Learn
  2. /
  3. Courses
  4. /
  5. Introduction to Data Visualization with Plotly in Python

Connected

Exercise

Side-by-side revenue box plots with color

The New York Stock Exchange firm you previously worked for has contracted you to extend your work building the box plot of company revenues.

They want to understand how different industries compare using this same visualization technique from before. They are also particular about what colors are used for what industries. They have prepared a list of industries and the colors as below.

Your task is to create a box plot of company revenues, as before, but include the specified colors based on the list of industries given below.

There is a revenues DataFrame already loaded for your use.

Industry-color RGB definitions:

  • Tech = 124, 250, 120
  • Oil = 112,128,144
  • Pharmaceuticals = 137, 109, 247
  • Professional Services = 255, 0, 0

Instructions

100 XP
  • Create a dictionary mapping each Industry to its RGB color.
  • Create a box plot of revenues, using Revenue as the y-axis.
  • Apply your industry color map to the plot.