Statistical Chart Generation: From CSV to Journal-Level Plots

Preface

When submitting to journals, figures are often returned for revision: wrong dimensions, unclear meaning of error bars, significance annotations lacking test descriptions. You can produce plots yourself with matplotlib or seaborn, but aligning rcParams, testing methods, and export formats with the guidelines often takes quite a lot of time.

Below we introduce the Statistical Chart Generation (coordinate @user_8d26dabd/academic-chart-gen) on SkillHub. It is designed for the Agent scenario: you hand the experimental data (CSV/Excel) and plotting intent to the AI, and the skill follows an embedded reference document workflow for statistical inference visualization, outputting publication-oriented artifacts such as PNG/SVG/PDF, while emphasizing academic ethics boundaries (no data fabrication, no P-hacking).

What This Is

Statistical Chart Generation (in-package slug: academic-chart-gen) is a community-sourced (community) Skill in the data-analysis category. The current version displayed on SkillHub is v2.0.12, the publisher coordinate is user_8d26dabd, and the page lists the author as Liu Nan. The SkillHub introduction summarizes it as: full automation of significance annotation, error bars, and journal-size presets, CSV in, figures out.

It is positioned in statistical inference visualization, rather than general-purpose data analysis or architecture/flow diagrams. There is clear routing with adjacent skills in the suite, such as academic-figure-gen (Graphviz-style structure diagrams) and academic-docx-toolkit (Word layout): data charts go to this skill, architecture diagrams go to figure-gen, and full Word document layout goes to the docx tool.

The tag requires_api_key=false means installing this Skill itself does not require an extra API Key; plotting still depends on the local Python environment and the libraries listed below.

Core Features

The following capabilities all come from the official SKILL.md and the references/ documents, and you can expand them for reading as needed.

Charts and Statistics

It supports 10 common statistical charts in papers: bar charts, box plots, violin plots, scatter plots, line plots, heatmaps, forest plots, ROC, Bland-Altman, and radar charts. Each type has complete Python examples in references/chart-types.md.

On the statistical side, it emphasizes:

  • Error bars: SEM / SD / 95% CI; see references/error-bars.md for selection guidance.
  • Significance annotation: asterisks, brackets, p-values, etc.; see references/significance-annotation.md; the document states that the test method and p-value must be included, and non-significant results should be presented truthfully.
  • Test integration: the workflow includes normality judgment and the selection among t-test, Mann-Whitney, ANOVA, Kruskal-Wallis, etc. (see the workflow in references/data-pipeline.md).

Journals and Output

references/journal-presets.md provides four sets of size and rcParams presets for Nature / Science / Elsevier / Chinese journals (GB/T) (including single-column and double-column size references in millimeters and inches). The document requires a resolution of ≥300 dpi and recommends 600 dpi export.

The data pipeline defaults to producing PNG (600 dpi) + SVG + PDF; optionally, it can work with academic-docx-toolkit to embed into Word (references/docx-integration.md).

Color Schemes and Data Pipeline

references/color-schemes.md covers colorblind-friendly schemes (e.g., Okabe-Ito) and grayscale-safe options for printing. references/data-pipeline.md describes the full workflow from reading CSV/Excel, cleaning, wide-to-long table conversion, to plotting and saving.

Triggers and Boundaries

Common Chinese trigger phrases include: academic chart, error bar, significance annotation, journal figure, turn a table into a chart, etc.; English triggers include academic chart, error bar, significance annotation, etc. The skill declares that it does not replace pure data analysis (for complex insights, it can route to data-analyst-pro), does not handle architecture/flow diagrams, and forbids data fabrication or tampering, as well as P-hacking-style visualizations; exported charts must be labeled “AI-generated, data sources must be verified.”

Installation and Activation

1. Install the SkillHub CLI (if not already installed)

Check or install according to the SkillHub installation instructions:

command -v skillhub && skillhub --version

If not installed, you can run:

curl -fsSL https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/install.sh | bash

(If you only need the CLI, you can add -s -- --cli-only after the command.)

2. Install this Skill

You must use --dir to point to the current Agent’s skills directory; otherwise it defaults to installing under ./skills/, which may not be recognized:

skillhub install @user_8d26dabd/academic-chart-gen --dir <your skills directory>

The SkillHub page also supports giving the following prompt to the AI so it can complete the installation according to the installation documentation:

Please install `@user_8d26dabd/academic-chart-gen` according to https://skillhub.cn/install/skillhub.md.

3. Skills directories for various clients (excerpted from the official installation documentation)

Environment Typical path
Cursor ~/.cursor/skills/
Claude Code ~/.claude/skills/
Codex ~/.codex/skills/ or .agents/skills/ under the project

After installation, refresh or restart the Agent as required by your client so that the skill is loaded.

4. Python dependencies

The skill documentation requires the local machine to have:

matplotlib>=3.7.0
seaborn>=0.12.0
pandas>=2.0.0
numpy>=1.24.0
scipy>=1.10.0

Before the Agent generates and runs the plotting script, please confirm that the above packages are installed in the current Python environment.

Typical Usage

Conversational entry

In an environment where the skill is enabled, such as Cursor or Claude Code, you can directly describe the task in natural language, for example:

  • “I have an experimental CSV; draw a bar chart with error bars and export it at Nature single-column size.”
  • “Compare two groups; add significance annotation; use SEM for error bars.”

The skill will first confirm that the data source is real experiments or a public dataset, then recommend the chart type, tests, and export parameters; key statistical parameters usually require your confirmation, and it will not automatically draw conclusions for you or auto-publish.

Reproducible code path

The official README gives a minimal example: applying journal rcParams, computing means and SEM, drawing a bar chart with between-group t-test significance annotation, and finally saving PNG/SVG/PDF. The core snippet is as follows (the data is a fictional example from the documentation):

import matplotlib.pyplot as plt
import numpy as np
from scipy import stats
from matplotlib import rcParams

rcParams.update({
    'figure.dpi': 600,
    'font.size': 7,
    'axes.labelsize': 7,
    'font.family': 'sans-serif',
})

np.random.seed(42)
groups = ['Control', 'Treatment A', 'Treatment B']
data = [np.random.normal(loc, 0.5, 30) for loc in [5.0, 6.2, 7.1]]

fig, ax = plt.subplots(figsize=(3.5, 3))
means = [np.mean(d) for d in data]
sems = [stats.sem(d) for d in data]
ax.bar(groups, means, yerr=sems, capsize=4, width=0.6)

t_stat, p_val = stats.ttest_ind(data[0], data[2])
sig = '***' if p_val < 0.001 else '**' if p_val < 0.01 else '*' if p_val < 0.05 else 'ns'
# … brackets and annotation see the full README …

plt.savefig('example_bar_chart.png', dpi=600)
plt.savefig('example_bar_chart.svg')
plt.savefig('example_bar_chart.pdf')

If starting from CSV, follow the steps such as load_and_clean_data in references/data-pipeline.md to read .csv / .xlsx, then enter the testing and plotting branches.

Applicable Scenarios and Notes

Who it is for

  • Research writers who need to turn experimental tables into paper figures with error bars and significance, aligned with the target journal width and dpi.
  • Those already using an Agent to write code and wanting to reduce manual stitching between “test selection + rcParams + multi-format export.”

Limitations and notes

  • Input data should be complete with clear column names; the documentation states that when the data has too few rows (e.g., fewer than 3), it is difficult to make meaningful statistical charts, so samples should be supplemented or the display approach adjusted.
  • Hand-drawn sketches, pure architecture diagrams, and animated/interactive charts are not the main scenarios for this skill and should be routed to other skills or tools.
  • Statistical conclusions and data authenticity are the responsibility of the author; the skill refuses requests that fabricate significance, selectively remove points, or other violations.
  • SkillHub page statistics (as of the data snapshot): rating 100000, downloads 5225; installation counts etc. change over time; refer to the live SkillHub page.

Closing

Statistical Chart Generation consolidates the key steps from CSV/Excel to publication-oriented statistical figures (error bars, significance, journal presets, multi-format export) into a set of Agent Skills and reference documents, suitable for division of labor with architecture-diagram-type skills. When you need to install or check for updates, you can open the SkillHub official pages:

  • Display page: https://www.skillhub.cn/skills/user_8d26dabd/academic-chart-gen
  • API coordinate: https://api.skillhub.cn/user_8d26dabd/academic-chart-gen
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye