返回顶部
c

chart-mpl

Generate PNG/SVG charts (line, bar, hbar, pie, stacked, scatter, area) from CSV data using matplotlib. Use when the user asks to visualize tabular data, produce BI-ready chart images, or compare multiple series.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.1.0
安全检测
已通过
167
下载量
0
收藏
概述
安装方式
版本历史

chart-mpl

# Chart MPL Generate chart images from CSV files with `scripts/chart_mpl.py`. ## Setup Create a virtual environment and install matplotlib (one-time): ```bash python3 -m venv ~/.openclaw/workspace/.venv_chart ~/.openclaw/workspace/.venv_chart/bin/pip install matplotlib ``` ## Quick start Run from workspace root: ```bash ~/.openclaw/workspace/.venv_chart/bin/python skills/chart-mpl/scripts/chart_mpl.py \ --csv /path/to/data.csv \ --xcol Mois \ --ycol Valeur \ --kind line \ --title "Monthly trend" \ --xlabel "Month" \ --ylabel "Value" ``` Output defaults to: `~/.openclaw/workspace/exports/images` ## Inputs - `--csv` path to CSV file - `--xcol` column for X axis - `--ycol` numeric column(s) for Y axis — comma-separated for multi-series (e.g. `Sales,Costs`) - `--kind` chart type: `line`, `bar`, `hbar`, `pie`, `stacked`, `scatter`, `area` - Optional: `--delim` if auto-detection fails (`;`, `,`, `\t`, `|`) - Optional: `--out` custom output path (PNG or SVG — format detected from extension) - Optional: `--title`, `--xlabel`, `--ylabel` - Optional: `--top N` show only top N categories by value (bar, hbar, pie, stacked). Multi-series ranks by row total. - Optional: `--sort` sort data before plotting: `x-asc`, `x-desc`, `y-desc`, `none` (default: `none`) - Optional: `--numfmt` number format on Y axis: `fr` (1,5M) or `en` (1.5M) — default: `fr` ## Chart types | Kind | Description | Multi-series | |-----------|--------------------------------------|:------------:| | `line` | Line chart with markers | yes | | `bar` | Vertical bar chart (grouped when multi-series) | yes | | `hbar` | Horizontal bar chart (grouped when multi-series) | yes | | `pie` | Pie chart (first Y column only) | no | | `stacked` | Stacked vertical bar (requires 2+ Y) | yes | | `scatter` | Scatter plot | yes | | `area` | Filled area chart | yes | ## Notes - Script auto-detects delimiters when possible. - Script tolerates European and US numeric formats (`1 234,56`, `1,234.56`). - Non-numeric values in `ycol` are converted to `NaN` with a warning. - Handles BOM-encoded CSV files (`utf-8-sig`). - Multi-series charts automatically show a legend and cycle through an 8-color palette. - Y-axis ticks use human-readable formatting (K, M, G suffixes) with French or English decimals. - `--top N` keeps the N highest categories. For pie charts, the remainder is aggregated into an "Other" slice. For bar/hbar/stacked, the rest are excluded. - Output format (PNG or SVG) is detected from the `--out` file extension. Default is PNG. ## End-to-end flow with SQL skill 1. Export query result to CSV using the `mssql` skill. 2. Run this script on that CSV. 3. Share the generated PNG path.

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 chart-mpl-1776071881 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 chart-mpl-1776071881 技能

通过命令行安装

skillhub install chart-mpl-1776071881

下载 Zip 包

⬇ 下载 chart-mpl v1.1.0

文件大小: 5.98 KB | 发布时间: 2026-4-14 10:52

v1.1.0 最新 2026-4-14 10:52
v1.1.0 — New chart types, multi-series, and BI improvements

- Added 5 new chart types: hbar, pie, stacked, scatter, area
- Multi-series support via comma-separated --ycol (e.g. Sales,Costs)
- Grouped bars for multi-series bar/hbar (no more overlap)
- --top N: keep top N categories; pie aggregates remainder into "Other"
- --sort: explicit sort modes (x-asc, x-desc, y-desc, none)
- --numfmt: human-readable Y axis with FR (1,5M) or EN (1.5M) formatting
- SVG output support (detected from --out extension)
- Accounting negatives (1,234.56) now parsed correctly
- Self-contained setup instructions in SKILL.md
- Fixed crash when --out is a filename without directory

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部