TABLE OF CONTENTS


plot::constructor

SYNOPSIS

    constructor {args} {

PURPOSE

Create a new single-plot Gnuplot object.

HOW TO USE

The 'plot' Gnuplot object is created as:

      set obj [pwtk::gp::plot new  ?OPTIONS?  ?HEAD.TERM?]

where OPTIONS are:

      -o  ORIENT
      -s  SX,SY
      -fs FONTSIZE
      -t  TITLE
      -spin
      -p
      -pause PAUSE

ARGUMENTS

OPTIONS

RETURN VALUE

The Gnuplot single-plot object.

SOURCE

        set options_initiated 0
        array set my_options [array get ::pwtk::gp::options]
        set page 1; # N.B. page must be 1 for new_page to work correctly

        # parse command-line options/arguments
        
        set argsOrig $args
        set nargmin 0
        set nargmax 1
        set usage "new ?-p?  ?-o ORIENT?  ?-s SIZE?  ?-fs FONTSIZE?  ?-t TITLE?  ?-pause PAUSE?  ?-spin?  ?HEAD.TERM?"
        ::pwtk::gp::parseOpt_term_

        if { $args ne {} } {
            set head [::pwtk::gp::head_ $args]
            set term [::pwtk::gp::term_ $args]
            set args [lrange $argsOrig 0 end-1]
        } else {
            set id [incr ::pwtk::gp::plot_id]
            set head [::pwtk::gp::head_ plot-$id.win]
            set term [::pwtk::gp::term_ plot-$id.win]
            set args $argsOrig
        }

        # -pause
        my pause_ -1 $opt(pause)

        # specially handle the -t option
        set title {}
        if { $term in $::pwtk::gp::gp(win.terminals) } {
            if { $opt(p) == 0 } {
                set t [string trim "$opt(t) ($pauseText to Exit)"]
            } else {
                set t [string trim "$opt(t) ($pauseText to continue to next page)"]
            }
            set title [list -t $t]
        }

        set prolog [::pwtk::gp::get_term {*}$args {*}$title $head.$term]\n
    }