Visualizer¶
High-quality figure generation.
Class Reference¶
Visualizer ¶
Visualization for ASCICat results.
Generates four key figure panels: - Panel A: 3D ASCI component space - Panel B: Rank vs adsorption energy (with quadratic trend) - Panel C: Volcano optimization landscape (ASCI contours) - Panel D: Top performers breakdown
For large datasets (>1000 catalysts), automatic stratified sampling is applied to ensure clear figures.
CRITICAL AXIS RULES: - All axis limits derived ONLY from sampled DataFrame - Rank axis is strictly 1 to N_sampled (no global ranks) - Energy axes reflect actual data range (not full 50k dataset) - Score axes normalized to [0,1] based on sampled data
| PARAMETER | DESCRIPTION |
|---|---|
results | ASCI calculation results from ASCICalculator TYPE: |
config | Reaction configuration object TYPE: |
auto_sample | Automatically sample large datasets (default: True) TYPE: |
n_samples | Number of samples for visualization (default: 1000) TYPE: |
renormalize_scores | Re-normalize scores after sampling for better 3D distribution (default: True) TYPE: |
Examples:
>>> calc = ASCICalculator('HER')
>>> calc.load_data('data/HER_clean.csv')
>>> results = calc.calculate_asci()
>>> viz = Visualizer(results, calc.config)
>>> viz.generate_publication_figures('figures/')
Functions¶
generate_publication_figures(output_dir='figures', dpi=600, formats=['png', 'pdf']) ¶
Generate all four figure panels.
| PARAMETER | DESCRIPTION |
|---|---|
output_dir | Output directory for figures TYPE: |
dpi | Resolution (default: 600) TYPE: |
formats | Output formats (default: ['png', 'pdf']) TYPE: |
plot_3d_pareto_space(figsize=(5.5, 5), panel_label='a') ¶
Panel A: 3D visualization of ASCI component space.
Shows the multi-objective optimization landscape with Activity, Stability, and Cost scores on three axes.
plot_rank_vs_adsorption(figsize=(5.5, 5), panel_label='b') ¶
Panel B: ASCI rank vs adsorption energy (volcano-style).
Shows the activity-performance relationship with the Sabatier volcano principle. Uses quadratic polynomial fit for the performance trend.
plot_volcano_optimization(figsize=(5.5, 5), panel_label='c', n_contours=20) ¶
Panel C: Volcano optimization landscape.
Shows ASCI contours over (ΔE, log₁₀ Cost) space, revealing the multi-objective optimization landscape.
CRITICAL: Computes ASCI using the formula on a grid, not interpolating raw values. Colorbar is 0-1 range.
plot_top_performers(figsize=(6, 5), panel_label='d', n_top=8) ¶
Panel D: Top performers breakdown.
Shows component score breakdown for top catalysts as grouped bar chart.
plot_combined_figure(figsize=(12, 10), save_path=None, dpi=600) ¶
Generate combined 4-panel figure.
create_interactive_3d(output_path=None, auto_open=False) ¶
Create interactive 3D visualization using Plotly.
generate_all_outputs(output_dir='results', dpi=600, include_interactive=True) ¶
Generate all outputs: static figures + interactive HTML.
Quick Reference¶
from ascicat.visualizer import Visualizer
viz = Visualizer(results, config, auto_sample=True)
# Generate all figures
viz.generate_all_outputs(output_dir='figures/')
# Individual plots
fig = viz.plot_3d_component_space()
fig = viz.plot_rank_vs_adsorption()
fig = viz.plot_volcano_optimization()
fig = viz.plot_top_performers()
Initialization¶
viz = Visualizer(
results, # DataFrame from calculate_asci()
config, # ReactionConfig from calculator
auto_sample=True, # Sample large datasets
default_dpi=600, # Output resolution
color_palette='colorblind' # Color scheme
)
Parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
results | DataFrame | Required | ASCI results |
config | ReactionConfig | Required | Reaction configuration |
auto_sample | bool | True | Sample datasets > 5000 |
default_dpi | int | 600 | Default resolution |
color_palette | str | 'colorblind' | Seaborn palette |
Methods¶
generate_all_outputs¶
Generate complete figure set.
viz.generate_all_outputs(
output_dir='figures/',
dpi=600,
formats=['png', 'pdf'],
include_interactive=True
)
generate_figures¶
Generate four-panel figure.
plot_3d_component_space¶
3D visualization of score space.
plot_rank_vs_adsorption¶
Activity volcano-style plot.
plot_volcano_optimization¶
ASCI contour landscape.
plot_top_performers¶
Score breakdown bar chart.
plot_asci_distribution¶
ASCI score histogram.
plot_score_correlations¶
Correlation matrix heatmap.
plot_pareto_2d¶
2D Pareto frontier projection.
plot_radar_chart¶
Spider/radar chart for catalyst comparison.
create_interactive_3d¶
Interactive Plotly 3D plot.
Output Formats¶
All static plots support:
- PNG (raster, default 600 DPI)
- PDF (vector)
- SVG (vector)
- EPS (vector)