Visualizing Data

Creates charts and graphs from data — for a report, a slide, or as a standalone image. Use whenever the task needs a visual representation of numbers, not just a table.

aaravriyer193 Updated

File contents

Visualizing data

Use matplotlib — reliable, scriptable, and produces a plain PNG that drops into a doc, deck, or presents directly.

pip install matplotlib
import matplotlib.pyplot as plt

fig, ax = plt.subplots(figsize=(8, 5))
ax.bar(["Q1", "Q2", "Q3", "Q4"], [12, 19, 15, 24])
ax.set_title("Revenue by quarter")
ax.set_ylabel("$K")
fig.savefig("/home/user/chart.png", dpi=150, bbox_inches="tight")

Pick the chart type deliberately: trend over time → line, parts of a whole → pie only if ≤5 slices (otherwise a bar), comparison across categories → bar, relationship between two variables → scatter.

For a chart destined for a slide or doc, generate the PNG first, then embed it (see generating-slide-decks / generating-word-docs) — don't try to build a native chart object in pptx/docx.

For a chart the user should see directly in chat, present_file the PNG.

aaravriyer193/skills/tree/main/visualizing-data commit fa11098df4

Frequently asked questions

npx skillmds@latest add aaravriyer193/visualizing-data