This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
StandardPlot is a Python package that provides consistent plotting configuration for data analysis. It automatically applies standardized styling to matplotlib plots with a custom color palette, specific fonts, and layout configurations.
- config.py: Contains
PlotConfigclass that manages all styling configurations via matplotlib rcParams. Features both legacy blue palette and synthesized optimal palette with colorblind accessibility. - utils.py: Contains
StandardPlotsclass with plotting utilities andPlotSaverfor consistent file management. Handles font application specifically for Bitstream Vera Sans Mono. - init.py: Package entry point that auto-applies global configuration on import.
The package uses a hierarchical configuration system:
- Base configuration defined in
PlotConfig.base_config - Custom JSON configs can override defaults
- Two palette modes: legacy blue (
#b0d8e3background) and synthesized optimal (#fafafabackground) - Global rcParams applied automatically on import
The package includes a sophisticated color system:
- Synthesized Optimal Palette: Default 6-color palette optimized for colorblind accessibility and perceptual separation
- Legacy Blue Palette: Original blue-based theme for backward compatibility
- Palette switching methods:
switch_to_synthesized_palette()andswitch_to_legacy_palette()
# Install dependencies for local testing
python setup_test.py
# Run comprehensive test suite
python test_standardplot.py
# Run usage examples
python example_usage.py# Install package locally for development
pip install -e .
# Build and install from setup.py
python setup.py installThe package is configured for Bitstream Vera Sans Mono font with fallback to system monospace. Font path is hardcoded to Windows location: C:\Users\steve\AppData\Local\Microsoft\Windows\Fonts\VeraMono.ttf
Font application is handled by apply_vera_font_to_axes() function which manually applies font properties to all text elements (labels, ticks, legends).
- Main package files are in root directory
- Test outputs save to
./figures/with organized subfolders - Multiple demonstration scripts show different aspects (palette comparison, integration demos)
- Color palette development files (
*palette*.py) contain experimental and showcase functionality
- Figure size: 14 × 10.5 cm (converted to inches in config)
- DPI: 300 for high-quality output
- Full border styling (all spines visible)
- Ticks only on bottom and left axes, pointing inward
- Grid disabled by default
- Consistent color cycling through palette arrays