RPLOT

An Interactive Utility to Access TRANSP Output

RPLOT is the standard interactive tool for inspecting TRANSP output. It can list available output quantities, plot scalar time traces, plot profiles and multigraph packages, compare quantities across runs, inspect comments and namelist values, and generate plot scripts for repeatable post-processing.

Capabilities

  1. Generate a table of contents with available 1-D and 2-D TRANSP output names.
  2. Plot scalar functions and multigraphs versus time.
  3. Plot functions of time and an additional coordinate, such as radius.
  4. List the contents of selected multigraph packages.
  5. Add or delete scalar and profile multigraph packages.
  6. Draw profile multigraphs.
  7. View comments and examine TRANSP namelist values.
  8. Create an index of graphs drawn during a session.
  9. Change the displayed name or abbreviation of a function.
  10. Redefine non-temporal x axes for plotting.
  11. Redirect table-of-contents output and select subsets for output options.
  12. Plot plasma MHD equilibrium information.
  13. Set plotting scale defaults.
  14. Read or extract UFILE time-series data for scalar multiplots.
  15. Use the calculator option to compute and plot user-defined functions of time or radius and time.
  16. Compare the same quantity for multiple TRANSP runs.
  17. Use the ALL_PLOT option to generate scripts for all available plot items.

Gnuplot Backend

RPLOT now includes a gnuplot backend in addition to the legacy terminal output. The gnuplot backend is selected with TERMINAL_TYPE=GNUPLOT or TERMINAL_TYPE=GP. It can be used interactively with an X11, Qt, or wxt gnuplot window, or in headless mode to generate image files directly.

Benefits

Basic setup

Interactive X11 plotting:

# Interactive X11 plotting
export TERMINAL_TYPE=GNUPLOT
export RPLOT_GP_TERM=x11

Headless PNG output:

# Headless PNG output
export TERMINAL_TYPE=GNUPLOT
export RPLOT_GP_OUTPUT=png
export RPLOT_GP_OUTDIR=./plots
mkdir -p "$RPLOT_GP_OUTDIR"

Keep editable gnuplot files:

# Keep generated .gp and .dat files for editing
export TERMINAL_TYPE=GNUPLOT
export RPLOT_GP_OUTPUT=png
export RPLOT_GP_OUTDIR=./plots
export RPLOT_GP_KEEP=1
mkdir -p "$RPLOT_GP_OUTDIR"

Export gnuplot files without running gnuplot:

# Export-only mode for scripted post-processing
export TERMINAL_TYPE=GNUPLOT
export RPLOT_GP_OUTDIR=./plots
export RPLOT_GP_KEEP=1
export RPLOT_GP_NOEXEC=1
mkdir -p "$RPLOT_GP_OUTDIR"

Generate include snippets for assembling custom multiplots:

# Also write .gpinc snippets without terminal/output directives
export TERMINAL_TYPE=GNUPLOT
export RPLOT_GP_OUTDIR=./plots
export RPLOT_GP_INCLUDE=1
mkdir -p "$RPLOT_GP_OUTDIR"

Gnuplot environment variables

Variable Typical values Description
TERMINAL_TYPE GNUPLOT, GP Enables the gnuplot backend.
RPLOT_GP_TERM x11, qt, wxt Sets the interactive gnuplot terminal. If unset and DISPLAY is available, RPLOT defaults to X11.
RPLOT_GP_OUTPUT png, pdf, svg Forces file output. The backend uses pngcairo, pdfcairo, or svg terminals. If no display is available and no terminal is specified, PNG output is selected automatically.
RPLOT_GP_OUTDIR ., ./plots Directory for output files. The directory must already exist.
RPLOT_GP_KEEP 0, 1 Keeps generated .gp and .dat files when set to 1. By default, temporary files are removed after plotting.
RPLOT_GP_INCLUDE 0, 1 Writes a .gpinc file without set term or set output commands, useful for composing custom multiplots. This also keeps the generated files.
RPLOT_GP_NOEXEC 0, 1 Skips execution of gnuplot and only writes the generated files. This also keeps the generated files.
RPLOT_GP_CNTR_LEVELS 15, integer values Sets the number of contour levels for 2-D contour plots.
RPLOT_GP_FONTSIZE 14, integer values Sets the base font size used in generated gnuplot scripts.
RPLOT_GP_LW 2, integer values Sets the line width for generated plots.
RPLOT_GP_BORDERLW 2, integer values Sets the plot border line width.
RPLOT_GP_WINBASE 0, integer values Sets the base gnuplot window number for interactive terminals. RPLOT offsets this value for 1-D, multigraph, 2-D, and 3-D plots.

Output files

When file output is selected, RPLOT writes files with names such as rplot_page000001_1d.png, rplot_page000001_multi.png, rplot_page000001_2d.png, or rplot_page000001_3d.png in RPLOT_GP_OUTDIR. If RPLOT_GP_KEEP=1, the matching gnuplot script and data files are kept with the same base name and extensions .gp and .dat.

Limitations

Running RPLOT

Generating a Table of Contents

Templates and Repeatable Plotting

RPLOT can record an interactive session and replay it for the same or a different run. At an RPLOT prompt, enter >filename to start recording commands into filename.tmi, and enter < to stop recording.

rplot t y NSTX.05 q 117899A02
>my_template
  ... interactive RPLOT commands ...
<

Replay the template for another run:

rplot t y NSTX.09 q 133046P05 @my_template

Templates can also use variable names. Enter the variable name in single quotes during template creation and provide the actual value when replaying the template.

'RunId'
117899A02

rplot @my_template/TokYr=NSTX.09/RunId=133046P05

Legacy Plot Output

The legacy SGLIB/PostScript path remains available for workflows that still rely on it. For new scripted and headless plot generation, the gnuplot backend is generally preferred because it produces editable gnuplot scripts and modern image formats directly.

export PLOT=",foo.plt-ps"

To write data to the PostScript file in the legacy path, type d at the pause prompt after the beep.

Additional Customization


Send comments and questions to transp_support