PlotSpec Schema Reference
This page provides the complete schema reference for the PlotSpec configuration model and its components. All documentation is automatically generated from the Pydantic model definitions to ensure accuracy.
PlotSpec
The main configuration model that defines all aspects of a plot.
- class yaml2plot.core.plotspec.PlotSpec(**data)[source]
Pydantic-based plot specification with fluent API.
Replaces PlotConfig with structured validation and composable workflow.
- model_config: ClassVar[ConfigDict] = {'extra': 'allow', 'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- classmethod from_file(file_path)[source]
Create PlotSpec from YAML file.
- Parameters:
file_path (
Union[str,Path]) – Path to YAML configuration file- Return type:
- Returns:
PlotSpec instance
- Raises:
FileNotFoundError – If file doesn’t exist
ValueError – If YAML is invalid or unsupported
XAxisSpec
Defines the X-axis configuration options.
YAxisSpec
Defines the Y-axis configuration options for each subplot.
Usage Examples
For practical examples of how to use these configuration options, see:
Quick Start Guide - Basic usage examples
Configuration Guide - Configuration guide with examples
Examples - Real-world use cases