home / skills / meleantonio / awesome-econ-ai-stuff / econ-visualization

This skill helps economists create publication-quality figures with consistent styling, labeled axes, and export-ready formats for papers and presentations.

npx playbooks add skill meleantonio/awesome-econ-ai-stuff --skill econ-visualization

Review the files below or copy the command above to add this skill to your agents.

Files (2)
SKILL.md
2.9 KB
---
name: econ-visualization
description: Create publication-quality charts and graphs for economics papers.
workflow_stage: communication
compatibility:
  - claude-code
  - cursor
  - codex
  - gemini-cli
author: Awesome Econ AI Community
version: 1.0.0
tags:
  - visualization
  - ggplot2
  - charts
  - publication
---

# Econ Visualization

## Purpose

This skill creates publication-quality figures for economics papers, using clean styling, consistent scales, and export-ready formats.

## When to Use

- Building figures for empirical results and descriptive analysis
- Standardizing chart style across a paper or presentation
- Exporting figures to PDF or PNG at journal quality

## Instructions

Follow these steps to complete the task:

### Step 1: Understand the Context

Before generating any code, ask the user:

- What is the dataset and key variables?
- What chart type is needed (line, bar, scatter, event study)?
- What output format and size are required?

### Step 2: Generate the Output

Based on the context, generate code that:

1. **Uses a consistent theme** for academic styling
2. **Labels axes and legends clearly**
3. **Exports figures** at high resolution
4. **Includes reproducible steps** for data preparation

### Step 3: Verify and Explain

After generating output:

- Explain how to regenerate or update the plot
- Suggest alternatives (log scales, faceting, smoothing)
- Note any data transformations used

## Example Prompts

- "Create an event study plot with confidence intervals"
- "Plot GDP per capita over time for three countries"
- "Build a scatter plot with fitted regression line"

## Example Output

```r
# ============================================
# Publication-Quality Figure in R
# ============================================
library(tidyverse)

df <- read_csv("data.csv")

ggplot(df, aes(x = year, y = gdp_per_capita, color = country)) +
  geom_line(size = 1) +
  scale_y_continuous(labels = scales::comma) +
  labs(
    title = "GDP per Capita Over Time",
    x = "Year",
    y = "GDP per Capita (USD)",
    color = "Country"
  ) +
  theme_minimal(base_size = 12) +
  theme(
    legend.position = "bottom",
    panel.grid.minor = element_blank()
  )

ggsave("figures/gdp_per_capita.pdf", width = 7, height = 4, dpi = 300)
```

## Requirements

### Software

- R 4.0+ or Python 3.10+

### Packages

- For R: `ggplot2`, `scales`, `dplyr`
- For Python: `matplotlib`, `seaborn` (optional alternative)

## Best Practices

1. **Use vector formats** (PDF, SVG) for publication
2. **Keep labels concise** and readable
3. **Document data filters** used in the figure

## Common Pitfalls

- Overcrowded plots without clear labeling
- Inconsistent scales across figures
- Exporting low-resolution images

## References

- [ggplot2 documentation](https://ggplot2.tidyverse.org/)
- [Tufte (2001) The Visual Display of Quantitative Information](https://www.edwardtufte.com/tufte/books_vdqi)

## Changelog

### v1.0.0

- Initial release

Overview

This skill creates publication-quality charts and graphs tailored to economics papers, with clean academic styling, consistent scales, and export-ready formats. It produces reproducible code (R or Python) and clear instructions so figures can be regenerated or adjusted. The focus is on readable labels, correct units, and journal-friendly vector exports.

How this skill works

I first ask about the dataset, key variables, desired chart type, and output size/format. Based on those answers I generate code that applies a consistent theme, labels axes and legends clearly, documents data preparation steps, and exports the figure at high resolution or as a vector file. I also provide verification steps, alternatives (log scales, faceting, smoothing), and notes on any data transformations used.

When to use it

  • Preparing figures for empirical results or descriptive tables
  • Standardizing visual style across a paper or presentation
  • Exporting figures to PDF, SVG, or high-resolution PNG for submission
  • Creating event-study plots, time series, scatter plots with fitted lines
  • Reproducing figures from supplementary code or replication packages

Best practices

  • Prefer vector formats (PDF or SVG) for line art and journal submission
  • Keep labels concise, use readable font sizes and sensible tick marks
  • Document every data filter and transformation used to generate the plot
  • Use a consistent theme and color palette across all figures
  • Avoid overcrowding: consider faceting, small multiples, or inset zooms

Example use cases

  • Event-study plot with shaded confidence intervals and baseline normalization
  • Line plot of GDP per capita over time for multiple countries with consistent scales
  • Scatter plot of earnings vs. education with fitted regression line and annotation
  • Bar charts of treatment/control means with error bars and balanced axis limits
  • Export-ready figure pipeline: data cleaning, plotting code, and ggsave/plt.savefig commands

FAQ

Which language should I use, R or Python?

Use R (ggplot2) if you prefer grammar-of-graphics syntax and easy PDF export; use Python (matplotlib/seaborn) if your workflow is Python-based. I can provide code for either.

How do you ensure journal-quality output?

I recommend vector formats, set base font sizes for readability, choose publication-safe color palettes, and export at appropriate dimensions and DPI. I include ggsave or plt.savefig settings to match journal requirements.