Data Visualization and Communication of Insights
What this domain tests
Visualization and communication: choosing a chart that matches the question, building it in Matplotlib or Seaborn, and labeling it so a reader can interpret it without your narration.
Core rules
- Chart choice: line for trends over time, bar for comparisons across categories, histogram for distributions, scatter for relationships, box plot for spread by group.
- Matplotlib has two interfaces: state-based (
plt.plot) and object-oriented (fig, ax = plt.subplots()); prefer the latter for multi-panel figures. - Always label axes, include units, and add a title that states the takeaway.
- Control the y-axis honestly; starting a bar chart at a non-zero value exaggerates differences.
- Aggregate before plotting when many points would overplot.
Worked example
For monthly revenue across three regions, use sns.lineplot(data=df, x='month', y='revenue', hue='region'), then ax.set_ylabel('Revenue (USD)'), ax.set_title('Region B closes the gap in Q3'), and plt.savefig('revenue.png', dpi=150). Reasoning: a line encodes time order; hue separates regions without a separate panel; the title states the insight, and savefig before show ensures the file is written even in non-interactive environments.
Traps that cost marks
- Calling
plt.show()beforesavefig()and saving a blank figure. - Truncating the y-axis on a bar chart to make a small difference look large.
- Using a pie chart with many slices or a 3D chart that distorts area.
- Plotting raw unaggregated data when the question is about group totals.
- Omitting units or a legend, so the chart is unreadable out of context.