chart-designer
2
总安装量
2
周安装量
#65785
全站排名
安装命令
npx skills add https://github.com/bluewaves-creations/bluewaves-skills --skill chart-designer
Agent 安装分布
opencode
2
gemini-cli
2
claude-code
2
github-copilot
2
codex
2
kimi-cli
2
Skill 文档
Chart Designer
A design-system for matplotlib charts. You get brand colors, typography, and named figure sizes â then write standard matplotlib code for everything else.
Dependencies
uv pip install matplotlib numpy cycler
Quick Start
import sys; sys.path.insert(0, "scripts")
from chart_theme import load_theme
import matplotlib.pyplot as plt
theme = load_theme(brand_path="path/to/brand-decathlon")
with theme.apply():
fig, ax = plt.subplots(figsize=theme.sizes["full-width"])
ax.bar(["Q1", "Q2", "Q3", "Q4"], [120, 150, 180, 210],
color=theme.palette.categorical[:4])
ax.set_title("Revenue by Quarter")
fig.savefig("chart.png")
plt.close()
How It Works
1. load_theme() â Load brand tokens
from chart_theme import load_theme
theme = load_theme(brand_path="path/to/brand-decathlon")
# Reads manifest.json â tokens.chart â palette, typography, axis, grid
# Without a brand kit, returns sensible defaults.
2. theme.apply() â Activate brand rcParams
with theme.apply():
fig, ax = plt.subplots(...)
# Inside this block, matplotlib uses brand fonts, colors, grid style.
# All standard matplotlib code works â bar, plot, scatter, imshow, etc.
fig.savefig("output.png")
# Outside the block, rcParams are restored to previous values.
3. theme.sizes â Named figure dimensions
fig, ax = plt.subplots(figsize=theme.sizes["full-width"])
Pre-defined sizes optimized for A4 PDF integration. See the table below.
API Reference
load_theme(brand_path=None, dpi=200) â ChartTheme
Loads a brand kit’s manifest.json and returns a configured theme.
Pass None for sensible defaults without a brand kit.
ChartTheme
| Attribute | Type | Description |
|---|---|---|
palette |
BrandPalette |
Color palettes (categorical, sequential, diverging) |
rcparams |
dict |
matplotlib rcParams dict (applied by theme.apply()) |
sizes |
dict |
Named figure size tuples â see table below |
dpi |
int |
Output resolution (default 200) |
brand_name |
str |
Brand name from manifest |
BrandPalette
| Attribute / Method | Description |
|---|---|
categorical |
list[str] â 8 hex colors for discrete series |
sequential |
list[str] â 7 hex colors lightâdark |
diverging |
list[str] â 7 hex colors negâpos |
highlight |
str â call-out emphasis color |
highlight_contrast |
str â text on highlight background |
categorical_colormap() |
ListedColormap from categorical palette |
sequential_colormap() |
LinearSegmentedColormap from sequential palette |
diverging_colormap() |
LinearSegmentedColormap from diverging palette |
Figure Sizes
Named sizes optimized for A4 PDF integration (25mm margins):
| Name | Width à Height | Use case |
|---|---|---|
full-width |
6.29″ Ã 3.93″ | Default, spans content area |
full-width-tall |
6.29″ Ã 5.24″ | Complex charts needing height |
half-width |
3.0″ Ã 2.5″ | Side-by-side pairs |
two-thirds |
4.19″ Ã 3.0″ | Medium placement |
square |
4.0″ Ã 4.0″ | Pie, donut, heatmap |
spark |
3.0″ Ã 1.0″ | Inline sparkline |
PDF Factory Integration
- Generate chart PNG using this skill
- Reference the PNG in your markdown:
 - Render the document with pdf-factory â the image is embedded automatically
- SVG output is also supported and will be auto-converted to PNG by pdf-factory
Use <figure> and <figcaption> for captioned charts:
<figure>
<img src="chart.png" alt="Revenue by Quarter">
<figcaption>Figure 1: Quarterly revenue growth (FY 2026)</figcaption>
</figure>
QA Checklist
After generating any chart, open the output image and verify:
- Labels readable â No overlapping text on any element: axis labels, tick labels, legends, annotations, pie/donut category names, percentage values. If labels overlap, adjust the chart type, font size, rotation, or layout
- Data accurate â Values in the chart match the source data; spot-check at least two data points
- Legend clear â Multi-series charts have a legend with all series labeled
- No clipping â Title, subtitle, axis labels, and legend are fully visible, not cut off at edges
- Contextual fit â Chart type suits the data story (don’t use pie for > 6 categories; use horizontal bar for long labels)
- Brand consistent â When using a brand kit, chart uses brand palette and typography
References
- Chart type cookbook â Read when implementing a specific chart type. Complete matplotlib examples for bar, line, pie, scatter, heatmap, and more.
- Chart token schema â Read when creating a custom brand kit or debugging token resolution. Full
tokens.chartmanifest.json specification.