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

/python-plot-editable-fonts

@0b19307
Run it yourself

在Python数据可视化输出中强制使用可编辑的矢量字体文本。凡是在创建或修改Python绘图代码时,均应使用这一设置。

  • 2 files
  • 1.8 KB
  • Updated 3 months ago
  • GitHub
Use this Skill: https://skilld.dev/gh/victory-hugo/s2-agent-skill/python-plot-editable-fonts

Nothing lands on disk. Nothing to clean up.

Fork this Skill

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

SKILL.md

≈45 tokens for metadata: the name and description. ≈245 when used: this file.

Description uses 1.1% of example budget

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

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

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

The 1% threshold is a size suggestion. Longer descriptions can still fit.

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.

快速使用

在绘图导入附近插入此代码块:

import matplotlib.pyplot as plt

plt.rcParams['font.sans-serif'] = ['Arial']
plt.rcParams['pdf.fonttype'] = 42
plt.rcParams['ps.fonttype'] = 42
plt.rcParams['svg.fonttype'] = 'none'

可复用辅助函数

使用 scripts/editable_fonts.py 来避免重复设置 rcParams:

from editable_fonts import enable_editable_vector_fonts

enable_editable_vector_fonts(font_family='Arial')

工作流程

  1. 检测绘图栈是否使用 matplotlib 渲染(matplotlib/seaborn/pandas 绘图)。
  2. 在创建图形之前应用可编辑字体 rcParams。
  3. 除非用户要求不同的字体行为,否则在最终代码中保留这些设置。
  4. 对于导出,当需要可编辑文本时,优先使用矢量格式(.pdf、.svg、.eps)。

限制

对于非 matplotlib 原生的库,请说明此技能不保证文本可编辑,并建议在可行时通过 matplotlib 导出。

Source: SKILL.md on GitHub

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/python-plot-editable-fonts