Plotting in an Analysis Plugin

PolyzyMD uses one extension workflow for new contributions: add a single Analysis subclass in src/polyzymd/analyses/.

If your contribution needs figures, put that logic in the plugin’s plot() method.

Use Extending the Analysis Framework as the main contributor guide.

What to Implement

  • plot(ctx) to generate figures for your analysis

  • optional helper functions — these can live in the same file for simple plugins, or be extracted to a _plotters.py module within the package

  • optional format() for matching CLI output and figures

When to Extract _plotters.py

As a plugin grows, extracting plotting functions into a dedicated _plotters.py module within the package keeps __init__.py focused on the Analysis lifecycle. This is the established pattern for rmsf, distances, secondary_structure, and contacts. Consider extracting when your plugin has 3+ plot functions or __init__.py exceeds ~500 lines.

See Extracting Plotting to _plotters.py in the extending analyses tutorial for details.

Next Step