Skip to content

Session-persistent plot style (avoid repeating aa.plot_settings()) #131

Description

@breimanntools

Problem

aa.plot_settings(...) must be called before nearly every figure — ≈54 calls across 18 tutorials/protocols, and every cheat-sheet recipe carries one. There is no way to set the publication style once per session.

Goal

Provide an opt-in way to set the plot style once — e.g. an aa.options['plot_settings'] dict applied automatically by plot classes, or an aa.plot_context(...) context manager — so repeated calls are unnecessary; default visuals unchanged when unset.

Requirements

  • Add a session-level mechanism in aaanalysis/plotting/ (+ aaanalysis/config.py): options['plot_settings'] applied lazily by plot entry points, or a plot_context manager.
  • Default (unset) behavior byte-identical to today (no implicit styling unless opted in).
  • Document the one-time setup; update tutorials/cheat sheet to set once.
  • numpydoc + Examples.

KPIs / Acceptance

  • With the session default set, figures match those from an explicit plot_settings() call (regression test).
  • With it unset, output byte-identical to the current default (regression test).
  • ≥1 test.

Scope / non-goals

No change to plot_settings defaults; not restyling existing plots.

Dependencies

aaanalysis/config.py is CONFIRM-FIRST. Part of the Simplify API epic #126.

Standards checklist

  • config.py CONFIRM-FIRST · numpydoc · regression test.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions