Generate standardized thesis-quality matplotlib figures. Loads data, applies thesis style, saves to src/plots/.
Generates a matplotlib figure using the thesis style and shared utilities. The user describes what they want and this skill produces a Python script that loads data, generates the figure, and saves it.
The user invokes /plot with a description of the desired figure:
/plot scatter de likes vs comments, coloreado por tipo de cuenta, escala log/plot ranking top-20 medios por engagement normalizado/plot distribucion temporal de posts, solo cuentas business/plot barchart de hashtags partidarios, republicanos vs democratasClarify if ambiguous (which metric, which subset, which scale).
Write a Python script that:
Always starts with these imports and setup:
import sys
sys.path.insert(0, str(Path(__file__).resolve().parent.parent))
from plot_utils import load_data, save_fig, apply_style, BLUE, TERRA, COLORS_ACCOUNT, COLORS_CONTENT
apply_style() # or apply_style(thesis_quality=True) for thesis figures
Loads data via load_data() — never hardcode the CSV path.
Applies any filtering/aggregation the user requested.
Creates the figure using matplotlib/seaborn.
Saves via save_fig(fig, "topic_description_YYYY-MM-DD.png").
{topic}_{description}_{date}.{ext}.png.Style rules:
BLUE, TERRA, COLORS_ACCOUNT, COLORS_CONTENT).apply_style() handles everything else (spines, fonts, grid).Show the user:
NEVER run the script without user confirmation.
On confirmation:
src/scripts/ (or a temp location if one-off).python src/scripts/script_name.py
If the figure is worth keeping, offer:
git add src/plots/filename.png src/scripts/script_name.py
git commit -m "Add {description} plot"
plot_utils — never redefine colors, DPI, or save logic.src/plots/ by default (not src/eda/capa_N/figuras/).src/scripts/.