FigureAtom
Note
This page is a reference documentation. It only explains the class signature, and not how to use it. Please refer to the Habitat Guide and Python API guide (v2.0) for usage.
- class FigureAtom(*args, **kwargs)[source]
Bases:
ProtocolOne drawable, persistable figure.
Implement this protocol to plug a custom figure into
Report.figureswithout subclassing HABIT types.drawmust return a matplotlib Figure orNone(skip). It must not write files.- stem(subject_id: str) str[source]
Return the destination filename stem (no directory, no suffix).
Built-in atoms use
<subject_id>_<kind>.Reportwrites that stem as-is whenfigure_layout="flat", and strips the leading<subject_id>_whenfigure_layout="by_subject".
- draw(ctx: SubjectContext) Any | None[source]
Return a matplotlib Figure, or
Noneto skip this subject.
- __init__(*args, **kwargs)