Communitygithub.com

SailRain/科學繪圖技能

繪製現有時域數值資料,以純時間序列或成對的相位軌跡與波形呈現,或將現有 MAT 分類平面渲染為剪切切片;安排、匯出並驗證圖形,以符合目標版面的配置。請勿用於生成模擬資料、修改模型、數值求解、設計分類準則或分析動力機制。

科學繪圖技能 是什麼?

此技能專為在如 Claude Code、Cursor、Codex 等 AI 代理平台中進行科學繪圖而設計,支援三種主要繪圖類型:純時間序列、成對的相位軌跡與波形,以及 MAT 分類平面的剪切切片。使用者需先確定繪圖類型與最終版面位置(例如單欄文件全寬、雙欄文件的單欄或跨欄),再讀取對應的參考檔案來套用標準化配置。技能強調從原始資料檔案直接讀取,不進行內插、降採樣或數值修改,且所有可見文字(包括刻度標籤、軸標籤、面板標籤等)預設使用 Times New Roman 字體,並可根據使用者明確指令調整字型大小。色彩方案統一依據 SailRain 預設或指定的配置,不允許從歷史圖形或標籤推斷語義;腳本必須以可重現的 MATLAB 程式碼撰寫,確保路徑建構與明確配置,最終輸出以英文 snake_case 命名。若無對應的 project AGENTS.md 指令,則依技能預設執行,並在使用者當前對話中的確認設定優先於技能預設值。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/SailRain/scientific-plotting-skill/tree/HEAD/scientific-plotting

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

Scientific Plotting Workflow

The user's current instructions and settings confirmed in the current conversation take precedence over this skill's defaults. Read and follow the applicable AGENTS.md instructions for the user's current working project, using the project and directory scope established by the host environment. Resolve these instructions from the working project rather than relative to the installed skill directory. If no applicable project instruction file exists, proceed under the other applicable instructions and this skill's defaults. The currently included plot types are pure time series, paired phase trajectories and waveforms, and sheared slices of MAT categorical planes. Establish a corresponding workflow before using any other plot type; do not apply rules specific to a similar plot type.

1. Plot Type and Placement Routing

For each task, determine the plot type first, then the final placement, and read exactly one corresponding file for each:

  1. Plot type
  2. Placement
  3. Physical dimensions explicitly provided in the user's current request override the corresponding default fields in the placement file; fields without overrides retain their existing presets. If the selected placement has no default dimensions, confirm the missing dimensions. Do not borrow values from another placement.

Color schemes are shared configuration across these two dimensions. Read the color-scheme reference when selecting curve or category colors. Use the selected scheme, or SailRain by default, unless explicit user colors or a confirmed task configuration override it. A scheme changes colors only; it does not change typography, geometry, colorbar placement, or export requirements.

2. Common Configuration and Input Principles

  1. Inspect the original files, metadata, and applicable existing programs specified by the user directly. Do not substitute screenshots, historical outputs, or older data with similar names. Configure input fields, columns, matrix orientation, variables, units, figure count, and order from the actual source or confirmed instructions.
  2. Centralize the configuration of inputs and their order, plot type, placement, display semantics, ranges, arrangement, dimensions, colors, text, and output location. Determine these from the original data, existing programs, and current conversation first. Ask only about information that cannot be verified and would affect the result.
  3. Treat original data as read-only: do not overwrite, reorder, reformat, or delete it. By default, faithfully use the original samples or classification cells without interpolation, downsampling, smoothing, or changes to numerical values. Apply the validity and orientation checks in the selected plot-type file.
  4. Do not infer variables, units, periods, attractors, or categories from filenames, numerical magnitudes, codes, or example colors. Identify discrepancies between conflicting sources. If semantics cannot be verified, confirm them first or, if the user accepts, faithfully use the original codes as labels.
  5. Preserve the file and figure order specified by the user or confirmed in the current conversation. Do not automatically reorder by filename or numerical value.

3. Common Graphics and Implementation Rules

  1. All visible text, including tick labels, axis labels, panel labels, parameter text, colorbar text, and any user-requested titles or legends, must use Times New Roman. Main text defaults to 8 pt; subscripts may use a smaller size as needed for layout. Use another font size when explicitly specified by the user. Check font availability before rendering; report a missing font and resolve it before claiming typography acceptance. Do not silently substitute one.
  2. Use a white canvas by default. Italicize variables and subscripts that represent variables; use upright type for units and descriptive subscripts. Follow the user's requirements for specific symbols, capitalization, and glyphs.
  3. Resolve colors using the shared color-scheme rules and the selected plot-type file. Preserve explicit user colors and confirmed task mappings; otherwise, use the selected scheme or the SailRain default. Record the scheme and actual color assignments in the task configuration. Do not transfer semantic meanings from historical figures, scheme provenance labels, or other datasets.
  4. Retain reproducible MATLAB scripts. Construct paths with mfilename('fullpath') and explicit configuration rather than relying on manual directory changes. Use English names for new files, functions, and variables. Write new or modified comments, prompts, figure titles, and labels in American English, preserving mathematical symbols as required by the task.
  5. Use output names specified by the user; otherwise, use English snake_case names that describe the figure content. Do not overwrite unrelated files with the same name; report conflicts first. Do not write real data or generated results into the installed skill directory.

4. Verification and Delivery

  1. Run MATLAB to completion. Check input sources, display mappings, sample or classification-cell counts, and ranges to confirm that the figures faithfully represent the original data.
  2. Verify positions and physical dimensions against the current plot type, placement, and user configuration. Explicitly specified millimeter dimensions must be accurate within 0.1 mm. Perform the output, data, and visual checks required by the selected plot-type file; do not substitute another plot type's export formats.
  3. Inspect a high-resolution rendering of the final acceptance files for fonts, font sizes, colors, line widths, labels, boundaries, clipping, overlap, and unnecessary whitespace. Correct any issues, then export and inspect again.
  4. Deliver the reproducible program and the final files required by the selected plot type. Briefly describe the plot type, placement, input and display mappings, user overrides, and output location. Report whether MATLAB ran successfully and which dimension, file, and visual checks were completed. Clearly disclose any verification that was not completed.

相關技能