- Text Annotations - Labels with optional arrows pointing to data
- Reference Lines - Horizontal or vertical lines marking specific values
- Shaded Regions - Colored rectangles highlighting ranges
Text Annotations
Add text labels to your plots with optional arrows pointing to specific coordinates.Basic Text Annotation
Text Annotation with Arrow
Point to specific data with an arrow:Customizing Text Annotations
Multiple Annotations
Reference Lines
Add horizontal or vertical lines to mark thresholds, baselines, or other important values.Horizontal Reference Line
Vertical Reference Line
Customizing Reference Lines
Multiple Reference Lines
Solid Reference Lines
Shaded Regions
Highlight ranges or regions of interest with semi-transparent colored rectangles.Horizontal Shaded Region
Shade between two Y values (spans the full X range):Vertical Shaded Region
Shade between two X values (spans the full Y range):Customizing Shaded Regions
Multiple Shaded Regions
Combining Annotations
All three annotation types can be combined on the same plot:Common Use Cases
- Significance Thresholds
- Baseline Comparisons
- Time Intervals
- Outlier Identification
- Phase Transitions
Highlight statistical significance thresholds (e.g., p-value cutoffs):
Coordinate System
All annotation coordinates are in data space (not pixel coordinates):Annotations with Log Scale
Annotations work seamlessly with log-scaled axes:Best Practices
Use shaded regions sparingly
Use shaded regions sparingly
Too many overlapping shaded regions can make plots cluttered and hard to read. Prefer 1-3 regions per plot.
Choose appropriate opacity
Choose appropriate opacity
- Use low opacity (0.1-0.2) for large regions
- Use higher opacity (0.3-0.4) for narrow regions
- Ensure shaded regions don’t obscure your data
Position text annotations carefully
Position text annotations carefully
- Place text near but not on top of data
- Use arrows to clearly point to the target
- Adjust
arrow_paddingto avoid overlapping with markers
Use consistent colors
Use consistent colors
Match annotation colors to your data colors for clarity:
Label reference lines when ambiguous
Label reference lines when ambiguous
Always add labels to reference lines unless the value is obvious from the axis ticks:
Implementation Details
Annotations are rendered in this order:- Shaded regions (drawn first, behind everything)
- Grid and axes
- Data plots
- Reference lines (drawn over data)
- Text annotations (drawn last, on top)
- Shaded regions don’t obscure data
- Reference lines are visible over data
- Text is always readable
Next Steps
- Library Usage - Core patterns for using Kuva
- Multi-Plot Figures - Creating complex multi-panel layouts