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:

PLOTTING OPTIONS

See ::pwtk::plot

ARGUMENT

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

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]
}