Project: Visualizing Sales Data
Project: Visualizing Sales Data
In this capstone project, we bring together all the data visualization capabilities mastered throughout this chapter—Matplotlib's Object-Oriented Architecture, Line & Bar Charts, Donut Charts, Seaborn Aesthetics, and Multi-Panel Dashboards—to build an automated Executive Sales Analytics Visual Dashboard.
1. Project Overview & Dashboard Layout
Our application processes retail transactional sales data and generates a high-resolution, publication-quality 4-panel visual dashboard (sales_dashboard.png):
+-------------------------------------------------------------------+ | EXECUTIVE RETAIL SALES DASHBOARD (2026) | +---------------------------------+---------------------------------+ | Panel 1: Monthly Trend | Panel 2: Category Breakdown | | - Continuous Line Chart | - Horizontal Bar Chart | | - Fill-between area | - Value annotations | +---------------------------------+---------------------------------+ | Panel 3: Regional Share | Panel 4: Units Sold Spread | | - Modern Donut Chart | - Seaborn Boxplot by Region | | - Percentage contributions | - Outlier & median detection | +---------------------------------+---------------------------------+
2. Complete Project Implementation
3. Sample Execution Simulation
The resulting sales_dashboard.png image provides a clean 300 DPI executive graphic combining four key statistical and operational perspectives in a unified palette.
Multiple Choice Questions
1. In our dashboard project, what makes Panel 3 render as a "Donut Chart" rather than a standard solid pie chart?
A. Passing style="donut" to Matplotlib B. Setting wedgeprops=dict(width=0.45) to hollow out the central area C. Adding an outer black border D. Setting shadow=True Answer: B Explanation: Defining a fractional width in wedgeprops cuts out the center of the pie, transforming it into a modern donut chart.
2. Which method was used in Panel 1 to shade the region beneath the revenue trajectory line?
A. ax.shade() B. ax.fill_between() C. ax.color_area() D. ax.background() Answer: B Explanation: ax.fill_between(x, y) fills the area between a curve and an axis baseline with a semi-transparent color.
3. Why does the script execute plt.close(fig) at the conclusion of dashboard generation?
A. To convert the image into PDF format B. To free the system memory and GUI canvas resources associated with the figure C. To force the operating system to shut down D. To upload the image to a cloud server Answer: B Explanation: Calling plt.close(fig) releases memory allocated to figures, preventing memory leaks in automated report generators.
4. What is the role of y=0.98 in fig.suptitle(..., y=0.98)?
A. It sets font thickness to 98% B. It positions the master super-title slightly below the very top edge of the canvas so it does not collide with subplots C. It rotates the text 98 degrees D. It specifies 98 DPI resolution Answer: B Explanation: The y parameter in suptitle specifies the vertical coordinate (from 0 to 1) for title placement on the figure canvas.
5. What statistical insights does the Seaborn boxplot in Panel 4 communicate that a simple average bar chart cannot?
A. The name of the salesperson B. The median, interquartile range (IQR), variance spread, and statistical outliers C. Currency exchange rates D. Network bandwidth Answer: B Explanation: Boxplots reveal data dispersion, medians, quartiles, and outlier anomalies that are masked when reducing data to a simple average.
Project 1: Expense Tracker with CSV
Continue learning with hands-on practice, examples, and exercises in the upcoming topic.
Related Lessons
| Previous Lesson | Next Lesson |
|---|---|
| Seaborn Basics | Project 1: Expense Tracker with CSV |
Practice Quiz
Test your understanding of this lesson with 5 questions. Each question has one correct answer.