SkillAgentSearch skills...

Pubfig

Publication-style scientific plotting for papers: common plot families, clean exports, and panel-first Figma assembly.

Install / Use

/learn @Galaxy-Dawn/Pubfig
About this skill

Quality Score

0/100

Category

Design

Supported Platforms

Universal

README

pubfig

<div align="center"> <img src="LOGO.png" alt="pubfig logo" width="100%"/> <p> <img src="https://img.shields.io/badge/Python-3.10%2B-3776AB?style=flat-square&logo=python&logoColor=white" alt="Python 3.10+"/> <a href="https://pypi.org/project/pubfig/"><img src="https://img.shields.io/pypi/v/pubfig?style=flat-square&logo=pypi&logoColor=white" alt="PyPI version"/></a> <a href="https://pypi.org/project/pubfig/"><img src="https://img.shields.io/badge/pip%20install-pubfig-3775A9?style=flat-square&logo=pypi&logoColor=white" alt="pip install pubfig"/></a> <img src="https://img.shields.io/badge/Matplotlib-3.8%2B-11557C?style=flat-square" alt="Matplotlib 3.8+"/> <img src="https://img.shields.io/badge/License-MIT-green?style=flat-square" alt="License"/> <a href="https://github.com/Galaxy-Dawn/pubfig"><img src="https://img.shields.io/github/stars/Galaxy-Dawn/pubfig?style=flat-square" alt="GitHub Stars"/></a> </p>

<strong>Language</strong>: <a href="https://github.com/Galaxy-Dawn/pubfig/blob/main/README.md">English</a> | <a href="https://github.com/Galaxy-Dawn/pubfig/blob/main/README.zh-CN.md">中文</a>

</div>

Publication-style figures for papers, from single plots to panel-first Figma assembly.

pubfig is a Matplotlib-native plotting library for researchers who want figures that already look close to the final paper figure. It combines common scientific plot families, journal-aware export, and a panel-first Figma workflow for assembling large multi-panel figures without rebuilding artwork by hand.

Project links: PyPI · GitHub · Examples

Highlights

  • Paper-Ready Defaults, Not a Blank Canvas — Titles, legends, fonts, line widths, and spacing start from a more publication-like baseline.
  • Common Scientific Plot Families in One API — Statistical plots, distributions, trends, dimensionality reduction, evaluation curves, heatmaps, and flow plots live in one consistent surface.
  • Journal-Aware Export Without Boilerplatesave_figure(...) and batch_export(...) handle explicit output suffixes, column widths, DPI, and trimming directly.
  • Panel-First Workflow for Composite Figures — Export clean subplot assets, then assemble and refresh full figures in Figma instead of re-drawing panels manually.
  • Matplotlib-Native and Script-Friendly — Plot functions return standard Matplotlib Figure objects, so they drop into existing analysis code easily.

Recent News

  • 2026-03-31: pubfig 0.2.2 adds ECDF, QQ, Bland–Altman, Calibration, and UpSet, and brings them into the homepage showcase and full gallery.
  • 2026-03-30: pubfig 0.2.1 refreshed the PyPI release with stronger polar/composition coverage and fuller gallery examples.
  • 2026-03-29: pubfig 0.2.0 landed on PyPI with pip install pubfig, suffix-based export, and the documented panel-first Figma workflow.
<details> <summary><strong>View older changelog</strong></summary>
  • 2026-03-25: Panel-first Figma loop polish — panel export now defaults to title-free assets for cleaner Figma assembly, pubfig-sync now keeps shared title / legend placeholders off by default, and bridge/watch flows now surface bundle provenance plus the exact manual-fallback bundle path.
  • 2026-03-20: Local bridge automation for Figma sync — added a bridge-backed pubfig figma bridge|sync|watch workflow, upgraded pubfig-sync with bridge connection mode, and enabled CLI-triggered vector import/refresh after one-time plugin connection.
  • 2026-03-20: Figma plugin v2 workflow polish — added auto / hero_top relayout presets, upgraded shared title / legend placeholders, and improved refresh behavior so manual Figma positioning is preserved more reliably unless relayout is requested.
  • 2026-03-20: CLI + Figma plugin workflow — added pubfig figma package|validate|inspect, introduced a single-file Figma bundle JSON format for exported panels, and scaffolded the figma-plugin/pubfig-sync plugin for node-level import and refresh.
  • 2026-03-20: Figma-first panel export workflow — added export_panel(...) and export_panels(...) for stable subplot asset export, introduced a minimal panel-index.json sync index, and documented the Codex + Figma MCP refinement path for multi-panel figures.
  • 2026-03-20: README alignment with pubtab style and homepage refresh — reorganized the README into a pubtab-style homepage with centered badges, language switch, highlights, dated recent news, showcase examples, and an embedded gallery hero.
  • 2026-03-20: Default full install and metadata simplification — changed pip install pubfig to install the full plotting stack by default, removed user-facing extras from the main install path, and aligned package metadata, GitHub About, and README wording.
  • 2026-03-19: Raincloud plot support and gallery refresh — added raincloud(...), tuned its default styling, integrated it into the gallery, and regenerated the exported figure set.
  • 2026-03-19: PCA biplot and radar default updates — expanded pca_biplot(...) with loading panel modes and group ellipses, refreshed radar defaults, unified font handling, and re-exported the gallery.
</details>

Examples

Showcase

Single-plot examples

<p align="center"> <a href="examples/bar_scatter.png"><img src="examples/bar_scatter.png" width="32%" alt="Bar scatter example"></a> <a href="examples/raincloud.png"><img src="examples/raincloud.png" width="32%" alt="Raincloud example"></a> <a href="examples/line.png"><img src="examples/line.png" width="32%" alt="Line example"></a> </p> <p align="center"> <a href="examples/radar.png"><img src="examples/radar.png" width="32%" alt="Radar example"></a> <a href="examples/scatter.png"><img src="examples/scatter.png" width="32%" alt="Scatter example"></a> <a href="examples/heatmap.png"><img src="examples/heatmap.png" width="32%" alt="Heatmap example"></a> </p>

New plot families

<p align="center"> <a href="examples/ecdf.png"><img src="examples/ecdf.png" width="32%" alt="ECDF example"></a> <a href="examples/qq.png"><img src="examples/qq.png" width="32%" alt="QQ plot example"></a> <a href="examples/bland_altman.png"><img src="examples/bland_altman.png" width="32%" alt="Bland-Altman example"></a> </p> <p align="center"> <a href="examples/calibration.png"><img src="examples/calibration.png" width="48%" alt="Calibration example"></a> <a href="examples/upset.png"><img src="examples/upset.png" width="48%" alt="UpSet example"></a> </p> <p align="center"> <a href="examples/dumbbell.png"><img src="examples/dumbbell.png" width="48%" alt="Dumbbell example"></a> <a href="examples/forest_plot.png"><img src="examples/forest_plot.png" width="48%" alt="Forest plot example"></a> </p> <p align="center"> <a href="examples/hexbin.png"><img src="examples/hexbin.png" width="48%" alt="Hexbin example"></a> <a href="examples/volcano.png"><img src="examples/volcano.png" width="48%" alt="Volcano example"></a> </p> <p align="center"> <a href="examples/grouped_scatter.png"><img src="examples/grouped_scatter.png" width="48%" alt="Grouped scatter example"></a> <a href="examples/radial_hierarchy.png"><img src="examples/radial_hierarchy.png" width="48%" alt="Radial hierarchy example"></a> </p> <p align="center"> <a href="examples/circular_stacked_bar.png"><img src="examples/circular_stacked_bar.png" width="48%" alt="Circular stacked bar example"></a> <a href="examples/circular_grouped_bar.png"><img src="examples/circular_grouped_bar.png" width="48%" alt="Circular grouped bar example"></a> </p>

Composite figure examples assembled in Figma

<p align="center"> <a href="examples/composite-showcase-benchmark.png"><img src="examples/composite-showcase-benchmark.png" width="96%" alt="Benchmark composite figure assembled in Figma"></a> </p> <p align="center"> <a href="examples/composite-showcase-intervention.png"><img src="examples/composite-showcase-intervention.png" width="96%" alt="Intervention composite figure assembled in Figma"></a> </p> <p align="center"> <a href="examples/composite-showcase-stratification.png"><img src="examples/composite-showcase-stratification.png" width="96%" alt="Stratification composite figure assembled in Figma"></a> </p> <details> <summary><strong>Full Gallery</strong></summary>

The full gallery below also includes the newest diagnostics, evaluation, and set/composition families such as ECDF, QQ, Bland–Altman, Calibration, and UpSet.

<p align="center"> <img src="examples/gallery-hero.png" width="100%" alt="Full gallery contact sheet"> </p> </details>

Quick Start

pip install pubfig

Python Quick Start

Start with the fewest possible parameters first:

import numpy as np
import pubfig as pf

rng = np.random.default_rng(0)
means = np.array([
    [0.78, 0.96],
    [0.88, 1.08],
    [0.84, 1.00],
], dtype=float)

data = rng.normal(loc=means[..., None], scale=0.08, size=(3, 2, 18))
data = np.clip(data, 0.0, None)

fig = pf.bar_scatter(data)
pf.save_figure(fig, "figure1.pdf")

This is enough to get your first figure out. You do not need to understand layout, export, or publication-specific parameters before the first run.

Most common next parameters

Once the minimal example works, these are usually the first parameters worth adding:

fig = pf.bar_scatter(
    data,
    category_names=["Condition A", "Condition B", "Condition C"],
    series_names=["Ctrl", "Treatment"],
    title="Bar + Scatter",
)

pf.save_figure(fig, "figure1.pdf", spec="nature", width="single")
  • category_names: names on the x-axis
  • series_names: names in the legend
  • title: figure title
  • spec / width: journal-style export presets

Only add parameters like aspect_ratio or trim when you already know why you need them.

Where to look up detailed parameters

If you want to unde

Related Skills

View on GitHub
GitHub Stars70
CategoryDesign
Updated13h ago
Forks13

Languages

Python

Security Score

100/100

Audited on Apr 6, 2026

No findings