Customizing Plots for Publication
PolyzyMD generates plots automatically when you run analyses. This guide shows
you how to control output format, resolution, figure size, and style using
plot_settings in comparison.yaml.
Environment Setup
All commands below assume you have activated the PolyzyMD pixi environment:
pixi shell -e build
Alternatively, prefix each command with pixi run -e build.
The plot_settings block
Add this block to comparison.yaml:
plot_settings:
format: "png" # or "pdf", "svg"
dpi: 300
style: "publication" # or "presentation", "minimal"
These fields are defined in PolyzyMD’s PlotSettings model:
formatOutput file format
Allowed values:
png,pdf,svg
dpiPlot resolution
Allowed range:
50to600Primarily affects raster output (
png)
styleGlobal style preset
Allowed values:
publication,presentation,minimal
You can also set these optional global fields:
output_dir(default:figures/)color_palette(default:tab10)theme(fine-grained visual overrides)
Example with all global fields:
plot_settings:
output_dir: "figures/"
format: "png"
dpi: 300
style: "publication"
color_palette: "tab10"
Changing output format
Switch file format by changing plot_settings.format.
PNG
plot_settings:
format: "png"
dpi: 300
style: "publication"
Use PNG for quick drafts, sharing in chat/slides, and embedding in docs.
PDF
plot_settings:
format: "pdf"
dpi: 300
style: "publication"
PDF is vector output, so it scales cleanly.
SVG
plot_settings:
format: "svg"
dpi: 300
style: "publication"
SVG is vector output and is convenient for web use and post-editing.
Changing DPI
Set plot_settings.dpi to control raster resolution.
plot_settings:
format: "png"
dpi: 150
style: "publication"
Common ranges:
72-150: screen and draft output300: print/publication output600: high-resolution print output
Per-plugin plot settings
In addition to global settings, plugins can define their own plot options under
plot_settings.<plugin_name>.
RMSD example
plot_settings:
format: "pdf"
style: "publication"
rmsd:
show_per_replicate: true
figsize: [10, 6]
timeseries_figsize: [12, 5]
show_convergence_plots: true
convergence_figsize: [12, 5]
What changes:
show_per_replicate: trueoverlays each replicate tracetimeseries_figsizechanges the width/height of RMSD time plotsshow_convergence_plots: trueadds convergence diagnostics
RMSF example
plot_settings:
style: "publication"
rmsf:
show_error: true
highlight_residues: [77, 133, 156]
figsize_profile: [14, 4]
figsize_comparison: [8, 6]
What changes:
show_errorturns error shading/bars on or offhighlight_residuesadds vertical markers at selected residue IDsfigsize_*controls profile and comparison figure sizes
Contacts example
plot_settings:
style: "publication"
contacts:
generate_enrichment_heatmap: true
generate_system_coverage_heatmap: false
figsize_contact_fraction_profile: [16, 5]
show_contact_fraction_profile_error: true
highlight_residues: [77, 133, 156]
What changes:
generate_*flags turn specific plot families on/offfigsize_contact_fraction_profilesets profile dimensionsshow_contact_fraction_profile_errortoggles profile error bands
Re-generating plots after changing settings
After editing comparison.yaml, regenerate figures with:
polyzymd compare plot-all -f comparison.yaml
This command re-draws figures from existing comparison results. It does not recompute per-replicate or aggregated analysis data.
If a plugin has no cached comparison result yet, run that comparison first
(for example, polyzymd compare run rmsf -f comparison.yaml).