0
0
Matplotlibdata~30 mins

Dashboard layout patterns in Matplotlib - Mini Project: Build & Apply

Choose your learning style9 modes available
Dashboard layout patterns
📖 Scenario: You work as a data analyst for a small company. Your manager wants a simple dashboard to see sales data and customer feedback side by side. You will create a dashboard layout using matplotlib to show two charts in one window.
🎯 Goal: Create a dashboard layout with two charts side by side using matplotlib. The first chart will show sales data as a bar chart. The second chart will show customer feedback scores as a line chart.
📋 What You'll Learn
Create a dictionary called sales_data with product names as keys and sales numbers as values
Create a list called feedback_scores with 5 numeric values representing customer feedback
Use matplotlib.pyplot.subplots() to create a figure with two side-by-side plots
Plot a bar chart of sales_data on the left subplot
Plot a line chart of feedback_scores on the right subplot
Add titles to each subplot: 'Sales Data' and 'Customer Feedback'
Display the dashboard using plt.show()
💡 Why This Matters
🌍 Real World
Dashboards are used in many companies to show important data clearly and quickly. This project shows how to arrange multiple charts in one window for easy comparison.
💼 Career
Data analysts and scientists often create dashboards to communicate insights to managers and teams. Knowing how to layout multiple charts is a key skill.
Progress0 / 4 steps
1
Create sales data dictionary
Create a dictionary called sales_data with these exact entries: 'Apples': 30, 'Bananas': 45, 'Cherries': 15, 'Dates': 10, 'Elderberries': 5.
Matplotlib
Need a hint?

Use curly braces {} to create a dictionary. Separate keys and values with colons.

2
Create customer feedback scores list
Create a list called feedback_scores with these exact numeric values: 4, 5, 3, 4, 5.
Matplotlib
Need a hint?

Use square brackets [] to create a list of numbers separated by commas.

3
Create dashboard layout with two subplots
Import matplotlib.pyplot as plt. Use plt.subplots() to create a figure and two side-by-side axes stored in variables fig and axes. Then plot a bar chart of sales_data on axes[0] and a line chart of feedback_scores on axes[1]. Add the titles 'Sales Data' and 'Customer Feedback' to the respective subplots.
Matplotlib
Need a hint?

Use plt.subplots(1, 2) to create two plots side by side. Use axes[0].bar() for bar chart and axes[1].plot() for line chart. Use set_title() to add titles.

4
Display the dashboard
Add a line to display the dashboard window using plt.show().
Matplotlib
Need a hint?

Use plt.show() to open the window with your dashboard charts.