ahay/src/plotting-with-vplot

Claude Code and agent skill by ahay/src

Trust tier 2
  • community
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

Use when producing or debugging a vplot visualization in Madagascar — grey, graph, wiggle, contour, dots, overlays, and label escape codes.

Install

npx vskill@latest install ahay/src/plotting-with-vplot

SKILL.md

When to use

Use this skill any time a task involves:

  • Producing a .vpl file — Madagascar's portable vector/raster plot format.
  • Calling sfgrey, sfgraph, sfwiggle, sfcontour, sfdots, or sfbargraph from an SConstruct or at the command line.
  • Debugging a blank, mis-scaled, or mis-labeled plot.
  • Composing multiple plots into an overlay, side-by-side panel, or animation.
  • Writing axis labels that require subscripts, superscripts, or Greek letters.
  • Controlling color schemes, clip levels, or scalebars.

This skill does not cover converting .vpl to PDF/PNG (use sfpen options or vppen), or 3D surface plots (sfgrey3, sfsurf).


Mental model

What vplot is

Vplot is Madagascar's internal plot language — a compact binary stream describing lines, rasters, text, and color tables. Every visualization program (sfgrey, sfgraph, etc.) reads an RSF file and writes a .vpl stream. The .vpl file can be:

  • Displayed on screen with sfpen (wraps the xtpen or pspen driver).
  • Composed with other .vpl files using vppen.
  • Converted to PostScript with pspen.
Programs vs. the pipeline

Every vplot program is a standard Madagascar filter:

< data.rsf sfgrey color=j clip=1 title="My data" > out.vpl

At the command line, output goes to stdout. In SConstruct, SCons manages the filenames.

Plot vs. Result in SConstruct

Plot and Result are the two SConstruct functions that produce .vpl files.

FunctionOutput locationPurpose
Plot('name', ...)name.vpl (working dir)Intermediate — used as input to composition
Result('name', ...)Fig/name.vplFinal — what scons lock saves; what the paper uses

Rules of thumb:

  • Use Plot for any image you intend to overlay or combine.
  • Use Result for any image that is a deliverable on its own.
  • A Result with a composition string is both — it reads Plot-produced .vpl files and writes a final composed .vpl to Fig/.
How parameters reach the vplot program

In SConstruct, the second argument to Plot or Result is either:

  1. A flow string — the vplot program call with its parameters:

``python Result('img', 'grey title="My plot" color=j clip=2') ``

  1. A source list plus a composition keyword:

``python Result('combined', 'img1 img2', 'Overlay') ``

Parameters follow the same key=value syntax as any sf program. String values with spaces must be quoted.

Universal parameter inheritance

All vplot programs call sfstdplot internally (see sfdoc stdplot). This means axis labels, title, min/max, grid, screen size, and layout parameters are available to every vplot program, not just the one documented in its own sfdoc entry.


Core program catalog

ProgramDescriptionSignature
sfgrey2D raster/density plot. Maps float values to a color table. Default: transp=y yreverse=y.< 2D.rsf sfgrey [params] > out.vpl
sfgraph1D line plot. Plots n2 traces as separate curves along axis 1.< 1D.rsf sfgraph [params] > out.vpl
sfwiggleSeismic wiggle-trace display. Draws each trace as a waveform with optional filled polygons.< 2D.rsf sfwiggle [params] > out.vpl
sfcontourContour plot. Draws iso-value lines on a 2D field. Default: transp=y allpos=y.< 2D.rsf sfcontour [params] > out.vpl
sfdotsLollipop/impulse plot. Each sample becomes a vertical stick with a dot. Good for sparse signals.< 1D_or_2D.rsf sfdots [params] > out.vpl
sfbargraphBar chart. Columns of data become side-by-side or stacked bars.< 1D_or_2D.rsf sfbargraph [params] > out.vpl

Universal plot parameters

These parameters come from sfstdplot (run sfdoc stdplot) and are accepted by every vplot program.

ParameterDefaultEffect
title=(none)Title string. Supports escape codes.
label1=(from RSF header)Label for axis 1 (vertical when transp=y).
label2=(from RSF header)Label for axis 2 (horizontal when transp=y).
unit1=(from RSF header)Unit appended to label1 in parentheses.
unit2=(from RSF header)Unit appended to label2 in parentheses.
min1= / max1=(from data)Display range on axis 1.
min2= / max2=(from data)Display range on axis 2.
wantaxis=yn suppresses both axes. wantaxis1=/wantaxis2= are per-axis.
wanttitle=yn suppresses the title.
wheretitle=topTitle position: top, bottom, left, right.
wherexlabel=bottomHorizontal axis label position: top or bottom.
screenratio=device defaultFigure height/width ratio. 0.75=landscape, 1.5=portrait.
plotfat=0Line/curve thickness. 3=bold, 6=heavy.
plotcol=6 (yellow)Curve color: 0=black, 1=blue, 2=red, 3=magenta, 4=green, 5=cyan, 6=yellow, 7=white.
pclip=99 (grey), 98 (wiggle), 100 (others)Percentile clip.
grid1= / grid2=nDraw grid lines on axis 1 or 2.
dash=0Line dash: 0=solid, 1=fine dash, 2=dot, 3=dash, 4=large dash.
xll=/yll=/xur=/yur=(auto)Manual panel placement in inches.
crowd=0.75Fraction of frame used by plot area. crowd1=/crowd2= per axis.
labelsz=8Axis label font size. titlesz=10 for title.

Program-specific parameters

sfgrey — 2D raster/density plot

sfdoc sfgrey | source: plot/main/grey.c

Defaults: transp=y yreverse=y xreverse=n. With these defaults, axis 1 runs vertically (time, depth), axis 2 runs horizontally (trace, offset). This is the standard seismic display convention.

ParameterDefaultNotes
color=i (grayscale)Color scheme letter code. See Color schemes section below.
clip=(estimated)Hard clip value. Data outside [-clip, clip] saturates. If not set, estimated from pclip.
pclip=99Percentile used to estimate clip when clip= is not set. Set lower (e.g. pclip=95) to increase contrast.
bias=0Value mapped to the center of the color table. Shift to display asymmetric data better.
allpos=nIf y, assume all data is positive and use the full color range for positive values only. Useful for amplitude maps.
polarity=nIf y, reverse polarity: black represents high values, white represents low.
scalebar=nIf y, draw a colorbar beside the plot. Use minval=, maxval= to set bar range; barlabel= and barunit= to label it.
gainpanel=(none)Gain normalization panel: a (all panels together), e (each panel independently), or an integer panel number.
gpow=1Raise data to this power before display. Values < 1 compress dynamic range; > 1 expand it.
transp=yTranspose axes. Set transp=n to put axis 1 horizontal.
yreverse=yReverse vertical axis (time increases downward by default).
xreverse=nReverse horizontal axis.
mean=nIf y, set the bias to the data mean automatically.
symcp=nIf y, use a symmetric 255-color palette (ensures that the center color maps to zero exactly).
wantframenum=y if n3>1Show the current frame number in the corner for 3D data.

clip vs. pclip: pclip=99 (default) estimates clip from the 99th percentile. Set clip= explicitly for reproducible cross-panel display. gainpanel=a normalizes across all 3D frames; gainpanel=e per frame. For strictly positive data (envelopes, migration images) use allpos=y color=j.


sfgraph — 1D line plot

sfdoc sfgraph | source: plot/main/graph.c

Default: transp=n. Plots each column (n2 traces) as a curve, with axis 1 values on the vertical axis and axis 2 index on the horizontal.

ParameterDefaultNotes
transp=nIf y, transpose so axis 1 is horizontal. Use transp=y yreverse=y to plot a velocity curve in the same orientation as a grey plot.
yreverse=nReverse vertical axis.
min2=(from data)Minimum on the curve-value axis. Critical for overlay alignment — must match the background grey plot's axis range.
max2=(from data)Maximum on the curve-value axis.
plotcol=6Curve color. Use plotcol=2 for red, plotcol=1 for blue.
plotfat=0Curve fatness. plotfat=3 gives a bold curve suitable for overlays.
symbol=(none)If set, plot with symbols (markers) instead of lines. Letter determines marker shape.
symbolsz=2Symbol size.
wantaxis=yWhen used as an overlay, set wantaxis=n wanttitle=n to suppress the graph's own axes (using the background image's axes instead).
pad=yIf n, suppress extra padding around the plot area. Required for exact alignment with an underlying grey image.
dash=0Line dash pattern. dash=1 gives fine dashes; dash=3 gives coarse dashes.
pclip=100Clip percentile (usually leave at default for graphs).
color=jColor scheme (default is jet for graphs).

Overlay alignment: Both plots must share axis ranges. With sfgrey transp=y (default), axis 1 is vertical and min1/max1 control vertical range. With sfgraph transp=y yreverse=y, the curve values map to the vertical axis via min2/max2. Always use wantaxis=n wanttitle=n pad=n on the overlay graph.


sfwiggle — seismic trace display

sfdoc sfwiggle | source: plot/main/wiggle.c

Draws each trace as an oscillating waveform. Positive excursions can be filled (polygon mode).

ParameterDefaultNotes
clip=0 (estimated from pclip)Hard amplitude clip. If 0, estimated from pclip.
pclip=98Percentile used when clip=0.
poly=nIf y, fill positive excursions with solid polygons (standard seismic display).
polyneg=nIf y, also fill negative excursions (fills both sides).
zplot=0.75Scales the half-width allocated per trace relative to the d2 interval (zplot *= d2 internally). Default 0.75 leaves small gaps between traces; values > 1 cause traces to overlap.
transp=nTranspose axes. Default n means axis 1 is vertical (time), axis 2 is horizontal (trace).
yreverse=nReverse vertical axis. Set y to make time increase downward.
xreverse=nReverse horizontal axis.
fatp=1Polygon border fatness (line thickness of the filled wiggle boundary).
seemean=nIf y, draw a horizontal mean line through each trace.
xpos=(none)Optional auxiliary RSF file with explicit trace positions (allows irregular spacing).
xmask=1Polygon fill mask for x direction.
ymask=1Polygon fill mask for y direction.

Note on clip: sfwiggle requires an explicit positive clip to work properly. Either set clip=<value> directly, or rely on pclip=98 (the default) which estimates the clip from the data percentile. Setting clip=0 with no pclip produces no display.


sfcontour — contour plot

sfdoc sfcontour | source: plot/main/contour.c

Draws iso-value lines on a 2D scalar field. Defaults: transp=y allpos=y.

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
349
Repository forks
191
7-day trend score
29

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/ahay/src/plotting-with-vplot/badge)](https://verified-skill.com/skills/ahay/src/plotting-with-vplot)

Something wrong with this skill or its page? Tell us.