Skip to content

preordinary/science-plot-formatter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

science-plot-formatter

A Claude Code plugin that beautifies matplotlib scripts for scientific paper submission.

What it does

Given an existing .py plotting script, a target conference/journal, and the figure's fraction of column width on the page, the plugin renders the chart, inspects it critically, rewrites the visual system (figsize, fonts, linewidths, markers, ticks, legend weight), and re-renders to verify the result. It always renders before editing and again after editing — no code is rewritten from equations alone.

Skill

  • beautify-chart — the render → inspect → rewrite → re-render → verify loop. The skill looks up the venue's official author guidelines live (column width, body font size, required font family) and derives the target visual system from the figure's final physical width on the page, not from the current code values.

Installation

This is a Claude Code plugin. You need Claude Code already installed and working before installing the plugin.

Claude Code installs plugins from a marketplace, not directly from a GitHub URL. This repo ships its own single-plugin marketplace (see .claude-plugin/marketplace.json), so installation is two steps: add the marketplace, then install the plugin from it.

Install from GitHub (recommended)

In a Claude Code session, run:

/plugin marketplace add preordinary/science-plot-formatter
/plugin install science-plot-formatter@science-plot-formatter

The first command registers this repo as a marketplace named science-plot-formatter. The second installs the plugin (also named science-plot-formatter) from that marketplace, which is why the @ form repeats the name.

Install from a local clone (for development)

If you are hacking on the plugin itself:

git clone https://github.com/preordinary/science-plot-formatter.git

Then in Claude Code:

/plugin marketplace add /absolute/path/to/science-plot-formatter
/plugin install science-plot-formatter@science-plot-formatter

Edits to skills/beautify-chart/ are picked up the next time the skill is invoked — no reinstall needed.

Verify the install

After installation, run /plugin in Claude Code and confirm science-plot-formatter appears in the list with the beautify-chart skill enabled. You can also ask Claude to "beautify a matplotlib script for NeurIPS" and check that the beautify-chart skill is invoked.

Update / uninstall

/plugin marketplace update science-plot-formatter   # pull latest from GitHub
/plugin uninstall science-plot-formatter            # remove the plugin

Usage

Ask Claude Code something like:

Beautify path/to/plot.py for NeurIPS 2026. It's one full column wide.

The skill will:

  1. Look up NeurIPS 2026 author guidelines (column width, body pt).
  2. Render the script headlessly (MPLBACKEND=Agg) and read the PNG.
  3. List concrete visual issues at the target page width.
  4. Propose a unified plt.rcParams.update({...}) block plus per-call fixes (errorbar capsize/capthick, stale kwargs removed).
  5. Apply the edits, re-render, and verify each listed issue is resolved.

Data, colors, colormaps, linestyles, axis limits, and the user's composition are never touched.

Inputs

Input Example
script_path /path/to/plot.py
venue NeurIPS 2026, Nature Communications, ICML 2026
fraction 0.5 (half column), 1.0 (one column), 2.0 (double columns)

You do not need to supply column widths or body font sizes — the skill looks them up from the venue.

Requirements

  • Python with matplotlib installed on the machine running Claude Code.
  • The user's script must be runnable end-to-end (data loadable from the script's working directory).

Example

Before After

About

A Claude Code plugin that beautifies matplotlib scripts for scientific paper submission.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors