boofun.visualization.growth_plots
Growth and asymptotic visualization for Boolean function families.
This module provides specialized plotting tools for: - Asymptotic behavior as n grows - Family comparison plots - Theoretical vs computed overlays - Phase transition visualization
Functions
|
Quick way to visualize asymptotic behavior of a built-in family. |
Classes
|
Visualize query complexity measures and their relationships. |
|
Specialized visualizer for asymptotic behavior of Boolean function families. |
|
Specialized visualizations for Linear Threshold Functions. |
- class boofun.visualization.growth_plots.GrowthVisualizer(backend: str = 'matplotlib')[source]
Specialized visualizer for asymptotic behavior of Boolean function families.
Features: - Plot properties vs n with theoretical overlays - Compare multiple families - Visualize convergence rates - Show phase transitions
- __init__(backend: str = 'matplotlib')[source]
Initialize growth visualizer.
- Parameters:
backend – “matplotlib” or “plotly”
- plot_growth(tracker: GrowthTracker, marker_name: str, show_theory: bool = True, show_error: bool = True, log_x: bool = False, log_y: bool = False, figsize: Tuple[int, int] = (10, 6), title: str | None = None, ax=None, **kwargs)[source]
Plot a single tracked property vs n.
- Parameters:
tracker – GrowthTracker with computed results
marker_name – Which marker to plot
show_theory – Show theoretical prediction
show_error – Show error bars/ribbon (if available)
log_x – Use log scale
log_y – Use log scale
figsize – Figure size
title – Custom title
ax – Matplotlib axes (optional)
- Returns:
Figure/axes
- plot_family_comparison(trackers: Dict[str, GrowthTracker], marker_name: str, show_theory: bool = True, log_x: bool = False, log_y: bool = False, figsize: Tuple[int, int] = (12, 6), title: str | None = None)[source]
Compare a property across multiple function families.
- Parameters:
trackers – Dict mapping family names to GrowthTrackers
marker_name – Property to compare
show_theory – Show theoretical predictions
log_x – Use log scale
log_y – Use log scale
figsize – Figure size
title – Custom title
- Returns:
Figure
- plot_convergence_rate(tracker: GrowthTracker, marker_name: str, reference: str = 'sqrt_n', figsize: Tuple[int, int] = (10, 6))[source]
Plot ratio of computed value to theoretical reference.
Useful for seeing convergence rates and constant factors.
- Parameters:
tracker – GrowthTracker with results
marker_name – Property to analyze
reference – Reference function (“sqrt_n”, “n”, “log_n”, “constant”)
figsize – Figure size
- Returns:
Figure
- plot_multi_property_growth(tracker: GrowthTracker, marker_names: List[str] | None = None, figsize: Tuple[int, int] = (14, 4))[source]
Plot multiple properties side by side.
- Parameters:
tracker – GrowthTracker with results
marker_names – Which markers to plot (None = all)
figsize – Figure size (per subplot)
- Returns:
Figure
- class boofun.visualization.growth_plots.LTFVisualizer(backend: str = 'matplotlib')[source]
Specialized visualizations for Linear Threshold Functions.
- class boofun.visualization.growth_plots.ComplexityVisualizer(backend: str = 'matplotlib')[source]
Visualize query complexity measures and their relationships.
- boofun.visualization.growth_plots.quick_growth_plot(family_name: str, properties: List[str] = ['total_influence', 'noise_stability'], n_values: List[int] | None = None, **kwargs)[source]
Quick way to visualize asymptotic behavior of a built-in family.
- Parameters:
family_name – “majority”, “parity”, “tribes”, “and”, “or”, “dictator”
properties – Which properties to track
n_values – List of n values (default: odd 3-15)
- Returns:
Figure