Exercise

Visualizing sales by period

Now you have created your factors, it is time to build a bar plot visualizing sales per month, grouped into quarters!

grouped_melb, a pandas DataFrame containing one row for each month, its respective quarter, and total sales for that month, has been preloaded for you. Additionally, factors, which is a list of tuples containing each quarter and month pair, has also been preloaded.

Instructions

100 XP
  • Import NumeralTickFormatter and FactorRange.
  • Create the figure, using FactorRange() and factors for the x-axis, and labeling the y-axis as "Sales".
  • Add bar glyphs, setting x as factors, top as the "price" column of grouped_melb, and width as 0.9.
  • Rotate the x-axis labels to 45 degrees.