This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
py-ipaplots is a matplotlib style package that provides IPA (Innovations for Poverty Action) themed plotting styles for Python. It's a complete port of the Stata ipaplots package to Python/matplotlib with working examples and comprehensive documentation.
This project uses just (command runner) for common tasks. All commands should be run with just:
# Setup development environment (first time)
just get-started
# Install in development mode
uv pip install -e .
# Build package
just build-package
# Install from built package
just install-package
# Test CLI functionality (when implemented)
just test-cli
# Clean build artifacts
just clean-build
# Full development workflow
just package-workflow# Install in development mode
uv pip install -e .
# Build with uv
uv build
# Install with uv
uv pip install .src/ipaplots/: Main Python package__init__.py: Package initialization with style registrationipaplots.py: Main module (empty - ready for utility functions)styles/ipaplots.mplstyle: Complete matplotlib style sheet with IPA styling
examples/: Complete working examplesdemo_plots.py: Comprehensive script generating all 9 plot typesdata/ipaplots_test_data.dta: Original Stata test dataoutput/: Generated plot images (ignored by git)
ipaplots/: Contains the original Stata implementationscheme-ipaplots.scheme: Original Stata color scheme (ported ✅)ipaplots_test.do: Stata test file (recreated in Python ✅)ipaplots_test_data.dta: Test data (used in examples ✅)graphs/: Reference images for comparison
pyproject.toml: Package configuration with uv build backendJustfile: Command runner for development tasks.gitignore: Comprehensive Python package gitignorePLAN.md: Original development plan (mostly completed)
- Complete matplotlib style with IPA color palette (15 colors)
- Style registration - works with
plt.style.use('ipaplots') - Working examples - all 9 plot types from Stata version
- Real data integration - uses actual Stata test data
- Arial font styling - clean sans-serif typography
- uv build system - modern Python packaging
- Comprehensive documentation - README, examples, comments
- CLI interface for style management
- Utility functions for common plot types
- Color palette accessor functions
- Additional plot templates
- Unit tests
- Font: Arial (sans-serif) for all text elements
- Colors: 15 IPA brand colors converted from RGB to hex
- Grid: Subtle gray gridlines, clean white background
- Line styles: Solid for first 8 colors, dashed for remaining 7
The examples/demo_plots.py script generates 9 plot types:
- Scatter plot (var2 vs var5)
- Line graph (var2 over time by group)
- Pie chart (var1 sums by group)
- Box plot (all 5 variables)
- Histogram (var3 with percentage scale)
- Horizontal bar (means of all variables)
- Density plots (overlapping areas)
- Range plots (error bars)
- By graphs (subplots by group)
- Use
just get-startedfor initial setup - Use
just build-packageinstead ofuv builddirectly - Use
just install-packagefor testing installations - Use
just package-workflowfor complete test/build/verify cycle - Environment managed via
uv syncand.venv/ - Cross-platform support for Windows/Linux/macOS
- Make code changes
- Run
just install-packageto test locally - Run examples:
cd examples && uv run python demo_plots.py - Use
just package-workflowfor complete verification - Check generated plots in
examples/output/
# Test installation and examples
just install-package
cd examples
uv run python demo_plots.py
# Verify plots are generated in examples/output/
# Compare with reference images in ipaplots/graphs/# Test on TestPyPI first
just publish-test
# Publish to PyPI
just publish