ahay/src/plotting-with-vplot
Claude Code and agent skill by ahay/src
- community
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-vplotSKILL.md
When to use
Use this skill any time a task involves:
- Producing a
.vplfile — Madagascar's portable vector/raster plot format. - Calling
sfgrey,sfgraph,sfwiggle,sfcontour,sfdots, orsfbargraphfrom 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 thextpenorpspendriver). - Composed with other
.vplfiles usingvppen. - Converted to PostScript with
pspen.
Programs vs. the pipeline
Every vplot program is a standard Madagascar filter:
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.
| Function | Output location | Purpose | |
|---|---|---|---|
Plot('name', ...) | name.vpl (working dir) | Intermediate — used as input to composition | |
Result('name', ...) | Fig/name.vpl | Final — what scons lock saves; what the paper uses |
Rules of thumb:
- Use
Plotfor any image you intend to overlay or combine. - Use
Resultfor any image that is a deliverable on its own. - A
Resultwith a composition string is both — it readsPlot-produced.vplfiles and writes a final composed.vpltoFig/.
How parameters reach the vplot program
In SConstruct, the second argument to Plot or Result is either:
- A flow string — the vplot program call with its parameters:
``python Result('img', 'grey title="My plot" color=j clip=2') ``
- 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
| Program | Description | Signature | |
|---|---|---|---|
sfgrey | 2D raster/density plot. Maps float values to a color table. Default: transp=y yreverse=y. | < 2D.rsf sfgrey [params] > out.vpl | |
sfgraph | 1D line plot. Plots n2 traces as separate curves along axis 1. | < 1D.rsf sfgraph [params] > out.vpl | |
sfwiggle | Seismic wiggle-trace display. Draws each trace as a waveform with optional filled polygons. | < 2D.rsf sfwiggle [params] > out.vpl | |
sfcontour | Contour plot. Draws iso-value lines on a 2D field. Default: transp=y allpos=y. | < 2D.rsf sfcontour [params] > out.vpl | |
sfdots | Lollipop/impulse plot. Each sample becomes a vertical stick with a dot. Good for sparse signals. | < 1D_or_2D.rsf sfdots [params] > out.vpl | |
sfbargraph | Bar 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.
| Parameter | Default | Effect | |
|---|---|---|---|
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= | y | n suppresses both axes. wantaxis1=/wantaxis2= are per-axis. | |
wanttitle= | y | n suppresses the title. | |
wheretitle= | top | Title position: top, bottom, left, right. | |
wherexlabel= | bottom | Horizontal axis label position: top or bottom. | |
screenratio= | device default | Figure height/width ratio. 0.75=landscape, 1.5=portrait. | |
plotfat= | 0 | Line/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= | n | Draw grid lines on axis 1 or 2. | |
dash= | 0 | Line 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.75 | Fraction of frame used by plot area. crowd1=/crowd2= per axis. | |
labelsz= | 8 | Axis 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.
| Parameter | Default | Notes | |
|---|---|---|---|
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= | 99 | Percentile used to estimate clip when clip= is not set. Set lower (e.g. pclip=95) to increase contrast. | |
bias= | 0 | Value mapped to the center of the color table. Shift to display asymmetric data better. | |
allpos= | n | If y, assume all data is positive and use the full color range for positive values only. Useful for amplitude maps. | |
polarity= | n | If y, reverse polarity: black represents high values, white represents low. | |
scalebar= | n | If 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= | 1 | Raise data to this power before display. Values < 1 compress dynamic range; > 1 expand it. | |
transp= | y | Transpose axes. Set transp=n to put axis 1 horizontal. | |
yreverse= | y | Reverse vertical axis (time increases downward by default). | |
xreverse= | n | Reverse horizontal axis. | |
mean= | n | If y, set the bias to the data mean automatically. | |
symcp= | n | If y, use a symmetric 255-color palette (ensures that the center color maps to zero exactly). | |
wantframenum= | y if n3>1 | Show 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.
| Parameter | Default | Notes | |
|---|---|---|---|
transp= | n | If 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= | n | Reverse 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= | 6 | Curve color. Use plotcol=2 for red, plotcol=1 for blue. | |
plotfat= | 0 | Curve 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= | 2 | Symbol size. | |
wantaxis= | y | When used as an overlay, set wantaxis=n wanttitle=n to suppress the graph's own axes (using the background image's axes instead). | |
pad= | y | If n, suppress extra padding around the plot area. Required for exact alignment with an underlying grey image. | |
dash= | 0 | Line dash pattern. dash=1 gives fine dashes; dash=3 gives coarse dashes. | |
pclip= | 100 | Clip percentile (usually leave at default for graphs). | |
color= | j | Color 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).
| Parameter | Default | Notes | |
|---|---|---|---|
clip= | 0 (estimated from pclip) | Hard amplitude clip. If 0, estimated from pclip. | |
pclip= | 98 | Percentile used when clip=0. | |
poly= | n | If y, fill positive excursions with solid polygons (standard seismic display). | |
polyneg= | n | If y, also fill negative excursions (fills both sides). | |
zplot= | 0.75 | Scales 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= | n | Transpose axes. Default n means axis 1 is vertical (time), axis 2 is horizontal (trace). | |
yreverse= | n | Reverse vertical axis. Set y to make time increase downward. | |
xreverse= | n | Reverse horizontal axis. | |
fatp= | 1 | Polygon border fatness (line thickness of the filled wiggle boundary). | |
seemean= | n | If y, draw a horizontal mean line through each trace. | |
xpos= | (none) | Optional auxiliary RSF file with explicit trace positions (allows irregular spacing). | |
xmask= | 1 | Polygon fill mask for x direction. | |
ymask= | 1 | Polygon 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
- SKILL.md in the repositoryCheckingskills/plotting-with-vplot/SKILL.md
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
[](https://verified-skill.com/skills/ahay/src/plotting-with-vplot)