Command Palette

Search for a command to run...

Назад к скиллам
скилл № 92294

scistudio-write-plot

Use when the user wants a quick figure of a block's output: a matplotlib, seaborn, or ggplot2 chart drawn from one output port and shown in the Plots tab…

БесплатноБез исполняемых скриптов
jiazhenz026от jiazhenz026★ 30 звёзд на GitHub

Установить scistudio-write-plot в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Об этом скилле

scistudio-write-plot

1. What a plot is

A plot is a small script that draws a figure from one output port of one workflow node. It lives in plots/<plot_id>/ as two files: plot.yaml, which records the port the plot is bound to and how it renders, and a render script (render.py or render.R) that defines render(collection). The figure shows in the Plots tab of the GUI.

A plot is only for looking. It never becomes a workflow node, never edits the workflow, and never produces data or lineage for another step. Use it for a quick look while the user works. When the figure must be a saved, reproducible output of the pipeline, write a block that produces an Artifact instead (scistudio-write-block). When the user wants to change settings and watch the figure respond, offer a MiniApp (scistudio-write-miniapp).

scaffold_plot writes plot.yaml for you; you normally edit only the render script. The plot binds to the node id and output port, never to the node's display label, so two nodes with the same label stay distinct.

2. Steps to write a plot

  1. Find the target. Call list_plot_targets and pick the target whose node and output port hold the data to plot. Check latest_output_available; when it is false, the workflow has to run before the plot can draw. When the figure needs data from two or more ports, first combine them into one output (see "When a figure needs several outputs" in §4).
  2. Pick a starting point (optional). Call list_plot_examples(language=..., library=...) for a render body in matplotlib, seaborn, or ggplot2.
  3. Scaffold. Call scaffold_plot(plot_id=..., target_id=..., language=...) with the target_id from step 1, and read its warnings and next_step.
  4. Write render. Edit the render script: open the data from collection, draw the figure, and return it.
  5. Validate. Call validate_plot(plot_id=...) and fix every error.
  6. Run. Call run_plot_job(plot_id=...) and check status. On failure, read errors and stderr, fix the script, and run again.
  7. Look at the figure. A plot that ran can still be unreadable. Look at the rendered image and fix every visual problem listed in "Check the figure" (§4), then run again.
  8. Report. Tell the user the figure is in the Plots tab, and what it shows.

3. Anti-patterns

  • Binding a plot by a node's display label instead of a target_id from list_plot_targets.
  • Hand-writing plot.yaml instead of calling scaffold_plot.
  • Writing render(collection, context); the entrypoint takes only collection.
  • Importing from SciStudio in the render script; collection is the whole interface.
  • Returning None from render.
  • Reading a second port's output from files inside render because a plot binds to one port; combine the outputs into a CompositeData type instead.
  • Treating a plot as a workflow step: editing workflows/*.yaml from a plot task, or expecting a plot to feed another block or appear in lineage.
  • Running a plot without validate_plot, or reporting success without checking status.
  • Reporting a plot as done without looking at the rendered figure.
  • Treating the rendered file as a kept result; the next run overwrites it.

4. Defaults, tool sequence, and failure handling

What collection gives you. Python: collection.types, collection.items (len, iterate, index, slice), collection.items.open_one() for the first item, collection.items.open(max_items=n) for a list of items, and per item item.type, item.metadata, and item.open(). R uses the same names with $ (collection$items$open_one(), collection$itemsi$open()).

open() returns plain objects:

Item type Python R
Array numpy.ndarray matrix (2-D) or array
DataFrame pandas.DataFrame data.frame
Series pandas.Series; a DataFrame when stored with two or more columns (a spectrum's lambda and intensity) vector
Text str character
Artifact pathlib.Path character path
CompositeData dict of opened parts named list

Package types reach the script as their core base type; an Image opens as an Array. open() loads the data into memory under a size limit (64 MiB per input by default), so for a large input open fewer items or read only what the figure needs.

What render returns. Python: a matplotlib figure, a path to an image the script wrote in its working directory, or a list of either. R: a ggplot object, a path, or a list of either; base graphics drawn inside render are captured without a return value.

Figure size and style. Both languages default to 6.4 × 4.8 inches. Python plots also get a house style before render runs: large text (20 pt labels, 18 pt ticks and legend, 24 pt titles) and constrained layout, so they stay readable in the Plots tab. Keep the default size unless the figure needs more room: many categories, seve

Полный SKILL.md на GitHub

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл scistudio-write-plot?

Use when the user wants a quick figure of a block's output: a matplotlib, seaborn, or ggplot2 chart drawn from one output port and shown in the Plots tab (e.g. "scatter the measurements from my segment-cells node", "show me a histogram of that output"). A plot lives in `plots/<plot_id>/` and is preview-only. Not for a figure that must be a saved pipeline output (write a block that produces an `Artifact` with scistudio-write-block) or for exploring a result interactively (scistudio-write-miniapp).

Как установить скилл scistudio-write-plot?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл scistudio-write-plot запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить scistudio-write-plot с