Index of every page on this site: llms.txt
All skills
victory-hugo avatar

/code-visualization-palette

@0b19307
Run it yourself

精美的可视化调色盘,在数据可视化中使用;若使用tidyplots包,则不必使用本技能。

  • 4 files
  • 13 KB
  • Updated 3 months ago
  • GitHub
Use this Skill: https://skilld.dev/gh/victory-hugo/s2-agent-skill/code-visualization-palette

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈35 tokens for metadata: the name and description. ≈822 when used: this file. ≈2.5k more on demand in 3 files.

How this Skill uses context

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈72 characters, or 0.9%.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

代码可视化配色规范

概述

将本技能内置的配色规则应用到所有代码生成的图表、热图和统计图中。覆盖绘图库默认调色板,并为 Python、R 及其他绘图库显式输出 hex 颜色列表或连续色标对象。

强制规则

  • 用户未明确指定颜色时,必须使用本技能生成的调色板。
  • 若使用tidyplots包,则不必使用本技能生成的调色板。

图形语义到色板类型的映射

  • 分类变量、分组柱状图、分组散点图、分组箱线图和离散图例,使用 离散性配色。
  • 强度、表达量、密度、概率、单向递增热图等单方向连续变量,使用 连续性配色-单色系。
  • log2 fold change、相关性、残差、上下调等以中点为参照的双向连续变量,使用 连续性配色-双色系。

色板优先级与数量规则

离散型

  • 优先使用 离散性配色-1,其次使用 离散性配色-2。
  • 当 n <= 6 时,取 离散性配色-1 的前 n 个颜色。
  • 当 7 <= n <= 11 时,先用完整的 离散性配色-1,再按顺序补入 离散性配色-2 直到达到 n 个颜色。
  • 当 n > 11 时,以 离散性配色-1 + 离散性配色-2 组成的 11 个锚点色进行均匀插值。
  • 当 n > 11 时,必须提醒用户类别过多会降低颜色可辨识性,并建议合并类别、分面展示或增加形状、线型等辅助编码。

连续单色型

  • 优先使用 连续性单色-2,其次为 连续性单色-4、连续性单色-3、连续性单色-5。
  • 连续色标直接使用完整且有序的色带。
  • 分箱连续图从完整色带中等距抽样出 n 个颜色。
  • 不要打乱颜色顺序。

连续双色型

  • 优先使用 连续性双色-5,其次为 连续性双色-1、连续性双色-4、连续性双色-3。
  • 连续双色色标直接使用完整且有序的色带。
  • 对称分箱时按等距方式抽取颜色,并尽量保留中点附近的平滑过渡。
  • 除非用户明确要求反转高低值语义,否则不要反转左右方向。

语言与绘图库适配规则

  • 在 Python 中,离散色板优先输出显式的 list[str] hex 列表,连续色标优先使用 LinearSegmentedColormap.from_list(...)。
  • 在 R 中,离散色板优先输出显式的 c("#xxxxxx", ...) 向量,连续色标优先使用 scale_*_gradientn(colours = ...) 或等效函数。
  • 在 matplotlib、seaborn、plotly、ggplot2、ComplexHeatmap、altair、vega-lite 等库中,必须显式传入本技能生成的调色板,不依赖默认主题色。

参考文件

输出要求

  • 说明所选色板类型和具体色板名称。
  • 说明需要多少个颜色,以及这些颜色是如何截取、补齐或插值得到的。
  • 若离散类别过多并触发插值,应明确说明这一点。
  • 除非用户要求展开解释,否则保持说明简洁。

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No third-party reports yet.

Signed by skilld at 0b19307. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 3 days ago.

Activeupdated 3 months ago

README badge

README badge for victory-hugo/s2-agent-skill/code-visualization-palette