TABLE OF CONTENTS
::pwtk::splot
SYNOPSIS
proc ::pwtk::splot {args} {
USAGE
::pwtk::splot ?SPLOT-OPTIONS? ?PLOTTING-OPTIONS? DATAFN where DATAFN is either a datafile or a function to plot. SPLOT-OPTIONS are: -type TYPE -pal PALETTE -i INTERPOLATION -contour -cc CONTOUR_COLOR -clw CONTOUR_LINEWIDTH -zt ZTICS -cbt CBTICS -mz MZTICS -mcb MCBTICS -zl ZLABEL -cbl CBLABEL -zr ZRANGE -cbr CBRANGE -zf ZFORMAT -cbf CBFORMAT For PLOTTING-OPTIONS, see ::pwtk::plot.
SPLOT OPTIONS
Options specific for 3D surface plots:
- -type TYPE --- type of the Gnuplot splot: surface | both (default = surface; "TYPE = both" means surface + heatmap)
- -pal PALETTE --- color palette for the splot (PWTK has a dozen predefined palettes, see the image below)
- -i NX,NY --- interpolation degree along X- and Y-axis (default is set to auto-optimal interpolation)
- -contour --- plot contours
- -cc CONTOUR_COLOR --- assigns contour color
- -clw CONTOUR_LINEWIDTH --- contour linewidth
- -zt ZTICS --- Z-axis tics (aka ztics)
- -cbt CBTICS --- color-box tics (aka cbtics)
- -mz MZTICS --- frequency of minor tics marks for Z axis
- -mcb MCBTICS --- frequency of minor tics marks for color box (CB)
- -zl ZLABEL --- Z-axis label
- -cbl CBLABEL --- CB label
- -zr ZRANGE --- Z-axis range specified as MIN:MAX
- -cbr CBRANGE --- CB range specified as MIN:MAX
- -zf ZFORMAT --- format for the Z-axis numbers (in C syntax)
- -cbf CBFORMAT --- format for the color box
PLOTTING OPTIONS
See ::pwtk::plot
ARGUMENT
- DATAFN --- datafile or function to plot
PURPOSE
A fast way of making an splot from the x, y, f(x,y) tabulated data or an f(x,y) function. For a more elaborate 3D plotting, use the ::pwtk::gp::splot object-oriented interface instead.
If the datafile was created with the ::pwtk::write command, it is closed prior to being plotted.
The PWTK's predefined color palettes can be accessed with the -pal option. To invert a palette, use "-pal {PALETTE negative}", where PALETTE is one of:
Note that for PALETTE only a substring that uniquely identifies it is required. For example, "-pal pa" selects the "pale-rainbow" palette.
RETURN VALUE
- the name of created image (for file terminals)
- an empty string (for non-file terminals)
SOURCE
variable write_fid # parse args set arguments "DATAFN" splotParseOpt_ # plot's name if { $opt(out) ne {} } { set head [headname $opt(out) .$opt(t)] } else { if { [file exists $args] } { set head splot-[file tail [file rootname $args]] } else { set id [incr ::pwtk::gp::splot_id] set head splot-$id } } # datafile or function ? if { [file exists $args] } { # lastarg is a file finish $args set datafn [squote $args] } else { # lastarg is a function set datafn $args } # post-process specific options & create configured 'splot' object set gp [splotCreateConfigure_ $opt(type) l opt $head] set with [concat w $opt(w) $opt(clw)] # plot $gp plot [concat $datafn $opt(u) $with] return [::pwtk::gp::execDisplay_ $gp opt] }