Matplotlib
Overview
Foundational plotting. In VenusFactory execute via agent_generated_code. Helpers: src/tools/visualize/matplotlib/plot_template.py, style_configurator.py.
When to use / NOT
| Use matplotlib | Prefer |
|---|---|
| Custom artists, insets, unusual projections | — |
| Statistical EDA defaults | seaborn |
| Nature submission figures | nature_figure (load first) |
Quick patterns
import matplotlib.pyplot as plt
fig, ax = plt.subplots(figsize=(5, 4))
ax.plot(x, y)
ax.set_xlabel("..."); ax.set_ylabel("...")
fig.savefig(out_png, dpi=300, bbox_inches="tight")
plt.close(fig)
Prefer the OO API (fig, ax = plt.subplots) over pyplot state for multi-step agent code.
Common mistakes
- Forgetting dpi≥300 / session
output_dir - Leaving interactive
plt.show()in headless runs - Skipping
nature_figurefor publication output
References (progressive disclosure)
Trust order: SKILL.md (hub tools & envelopes) → topic refs → references/legacy_guide.md (archived; may be outdated).
read_skill(skill_id="matplotlib", relative_path="references/legacy_guide.md")
Load legacy only after the hub workflow in this file is insufficient.