- Home
- Skills
- Research & Analysis
- figure-contract
More screenshots
Works with the AI Agents you already use
Figure Contract
create better scientific figures.
Free
figure-contract
Example session with this skill installed
Audit this bar chart of gene expression. The y-axis starts at 0.5 to show the difference between treatment groups A and B. Sample size is 3 cultures per group.
- Read your context and instructions
- Compiled the figure-contract
The provided chart violates the
Magnitude promise of the figure contract. By starting the y-axis at 0.5, a small absolute difference is visually exaggerated, violating the principle of proportional ink. Additionally, the chart lacks explicit uncertainty intervals and does not distinguish between individual culture measurements and the group mean.
Revised Figure Specification
| Promise | Required Adjustment |
|---|---|
| Magnitude | Reset y-axis baseline to 0. Use a point-and-interval plot instead of bars to focus on differences. |
| Evidence | Show all $n=6$ observations as points; use a larger marker or crossbar for the mean. |
| Meaning | Label the y-axis as Log₂ Fold Change (if applicable) or Expression (units). |
| Context | Add a reference line at $y=1$ (or $y=0$ for log-scale) to show the baseline state. |
import matplotlib.pyplot as plt
from figure_contract import audit_figure, label_n
fig, ax = plt.subplots()
# Use points + error bars instead of truncated bars
ax.errorbar(['A', 'B'], [mean_a, mean_b], yerr=[sem_a, sem_b], fmt='o', color='black')
ax.scatter(['A', 'A', 'A', 'B', 'B', 'B'], raw_data, alpha=0.5)
ax.set_ylim(0, None) # Magnitude: start at zero
ax.set_ylabel('Expression (Units)')
ax.set_title('Treatment B shows 15% increase over Treatment A')
label_n(ax, n=[3, 3]) # Evidence: explicit n
audit_figure(fig)
plt.show()
Next steps
- Replace the bar geometry with
ax.errorbarto avoid the "truncated bar" trap. - Explicitly state whether the error bars represent SD, SEM, or 95% CI in the caption.
- Run
audit_figure(fig)to confirm all axis labels include units.
Connects securely to your tools. The creator never sees your data.
About this skill
Scientific figures are often technically correct but visually misleading. Truncated y-axes, hidden sample sizes, and inappropriate color scales lead to unwarranted inferences that compromise research integrity. This skill treats every visualization as a formal contract between the researcher and the reader, enforcing strict rules for magnitude, evidence, and context.
What it does
- Enforces proportional ink by ensuring bars and areas always start at zero to prevent magnitude distortion.
- Validates evidence reporting by requiring clear identification of sample size (n), experimental units, and uncertainty intervals.
- Standardizes color mapping by matching hue and lightness scales to the specific structure of the variable (categorical, sequential, or diverging).
- Audits chart selection by mapping specific scientific questions to the most effective visual encodings rather than defaults.
- Protects data integrity by preventing the joining of independent observations and ensuring missing data is visible rather than ignored.
How it works
- Analyze the raw data structure and the specific scientific comparison required.
- Apply the contract rules to determine the optimal chart type, scale transform, and color palette.
- Execute the
audit_figure(fig)command to check a Matplotlib figure against mechanical requirements like axis labeling and baseline positioning. - Refine the visualization based on a five-point self-review focusing on Magnitude, Meaning, Evidence, Context, and Claim.
Frameworks & tools
This skill includes a Python kernel with helper functions like audit_figure, diverging_norm, and label_n. It provides direct implementation mappings for Matplotlib in Python and ggplot2 in R.
Why this beats prompting it yourself
Generic prompts often produce aesthetically pleasing charts that violate core principles of graphical perception, such as using radius instead of area for bubbles. This skill codifies specific scientific standards (like Weissgerber and Crameri) into a strict logic gate that prevents common misleading practices.
Use cases
- Auditing figures for peer-reviewed journal submissions to ensure statistical transparency.
- Converting dense exploration plots into high-clarity presentation slides for technical audiences.
- Standardizing visual language across multiple panels in a complex supplemental data set.
Known limitations
Does not automate the creation of complex hierarchical models. Requires the user to manually define the experimental unit when n is not equal to the number of observations.
Requires manual definition of experimental units. Focuses on correctness over aesthetic styling. Best suited for Matplotlib and ggplot2 workflows.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
This skill has been used 2 times.
Trust & safety
Security scan
Security scan passed 1 month ago
- Free with an Agensi account
Permissions
No special permissions declared or detected