A strawberry harvest bar chart fixed through its traces, layout, and axes

Fill in the blanks · Basic · §9.3 Figure structure and updates

Fix the bar chart fig of the May harvest (boxes) at four strawberry farms. Paint every bar gray #BBBBBB, and then paint only the bar of the Elm farm orange #E69F00. The title is May strawberry harvest by farm, and the y-axis range is [0, 400].

Work out which part of the Figure the bar colors, the title, and the axis range belong to, and fill in the four blanks with method names and an argument. Grading changes the harvests and the order of the farms and draws the chart again.

Target figure for A strawberry harvest bar chart fixed through its traces, layout, and axes
Target figure

Code with blanks

import pandas as pd
import plotly.express as px

harvest = pd.DataFrame({
    "farm": ["Oak", "Pine", "Elm", "Ash"],
    "boxes": [310, 280, 365, 240],
})
fig = px.bar(harvest, x="farm", y="boxes", color="farm",
             labels={"farm": "Farm", "boxes": "Boxes picked"})
fig.____(marker_color="#BBBBBB")
fig.update_traces(marker_color="#E69F00", ____)
fig.____(title="May strawberry harvest by farm")
fig.____(range=[0, 400])
fig.show()

Solve this problem in your browser

Python runs in your browser and checks your answer right away. Hints and the answer are on the problem page.