Get startedGet started for free

Fixing a Plotly figure

Your colleague started a project to create a visualization of sales for the first three months of 2025. However, she then left for some annual leave—but the boss wants the visualization now!

You can see she left behind a dictionary object that has started to define the visualization. It is your task to finish this dictionary with the important key arguments to turn it into a Plotly visualization.

plotly.express as px and monthly_sales DataFrame have already been loaded for you.

This exercise is part of the course

Introduction to Data Visualization with Plotly in Python

View Course

Exercise instructions

  • Define x_column and y_column using the "month" and "sales" columns.
  • Set chart_title to "Sales for Jan-Mar 2025".
  • Create a bar plot using these variables.

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

# Define the x and y axis columns
x_column = "____"
y_column = "____"

# Define the chart title
chart_title = ____

# Create a bar plot
fig = px.____(
    data_frame=monthly_sales, x=____, y=____, title=____)

fig.show()
Edit and Run Code