Get startedGet started for free

Add Max Temperatures

The Australian Bureau Of Meteorology really enjoyed the plot you created for them but requested an edit.

They would like you to add the absolute maximum temperature to the plot created before. That is the highest temperature experienced anywhere in Sydney on that day.

A combined_fig has already been created for you, and a temp_syd_max DataFrame has been provided.

Your task is to add this new line chart to the existing plot.

This exercise is part of the course

Introduction to Data Visualization with Plotly in Python

View Course

Exercise instructions

  • Create a new line chart of the absolute Max temperature called abs_max_line_fig.
  • Add it to the existing combined_fig and show the new plot.

Hands-on interactive exercise

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

# Figure already created for you
combined_fig = Figure(data=[*daily_temp_fig.data, *monthly_avg_fig.data])

# Create a new line chart
abs_max_line_fig = px.____(temp_syd_max, x='Date', y='Max', color_discrete_sequence=['orange'])

# Add the new trace
combined_fig.____(____.data[0])

# Add a title
combined_fig.update_layout(title='Sydney Temperature Analysis')

# Show the combined figure
combined_fig.show()
Edit and Run Code