GraphicsOn TCL UTILITIES USER MANUAL GraphicsOn
SYNOPSIS
Initializes graphics
PACKAGE
TCLGPH
NAME
GraphicsOn
USAGE
GraphicsOn  Device cTable {revBW} {Canvas} {cS}
INPUT DEFINITIONS
Device - The graphics driver to use for output. Currently this should be set to TK. If you have the vtk plot package loaded you can try VTK, however, these drivers are not fully tested.
cTable - The color table to load. This can be any of the following:
RainBow - The classic set of rainbow colors running red to purple.
ETones - Almost a rainbow set of colors but the high end is more red-brown than red.
GrayShade - Shades of gray running light to dark.
DiColor - A double rainbow.
revBW - Optional input variable which allows black and white to be reversed. Default is NOSWAP which preserves black and white. Set to to SWAP to reverse the two colors.
Canvas - Optional input variable which informs the device initialization routine not to open a canvas but to use one which has been externally opened. The default setting is NONE which causes the routine to create a graphics canvas when invoked. To use an externally created canvas enter the canvas window name here.
cS - Optional input variable which is the canvas ID value. The default value is 0. If you don't wish the canvas to be created at this point set cS to OMIT. This causes the device initialization to be skipped and the canvas not to be created. It can be created later by a call to SetScreen
RETURN DEFINITION
NONE
DESCRIPTION
GraphicsOn is the graphics initialization routine and must be called before any graphics output can take place. The routine initializes all required graphics variables, initializes the graphics driver (of which TK is the only fully working one), loads the requested color table and if needed creates and displays a 750x500 pixel graphics canvas. The opened canvas size can be changed by setting the external variables GphInfo(xsScrL), GphInfo(ysScrL), GphInfo(xScrL), GphInfo(yScrL) prior to calling GraphOn. xsScrL and ysScrL set the X and Y pixel lengths of the canvas while xScrL and yScrL set the X and Y pixel lengths of the displayed canvas. If the canvas size is larger than the displayed canvas, scroll bars are added to the display.
When cS is not OMIT, GraphOn creates a single grraphics window with a canvas iD of cS. It also sets up a graphics window with an iD bWcS which covers the entire canvas. The window is scaled from 0 to 1 in both X and Y.
The canvas is created with a default black backround which can be changed with prior call to BackGround. Setting revBW to SWAP will cause black and white to be reversed everywhere. This produced a white canvas background with all graphics output in white being output in black.
ERRORS
None Generated
C BACKING
No
EXAMPLE(S)
EXAMPLE 1: Open up a standard graphics window for plotting, loading a rainbow colortable
# INITIALIZE graphics

GUIprefsRead
GraphicsOn TK RainBow
      
EXAMPLE 2: Open a standard graphics window for plotting, loading a earth tone colortable and reverse black and white. Set the canvas to be 800x600 with only 600x400 display.
      
# SET the canvas and canvas display size

set GphInfo(xsScrL) 800
set GphInfo(ysScrL) 600
set GphInfo(xScrL) 600
set GphInfo(yScrL) 400

# INITIALIZE graphics

GUIprefsRead
GraphicsOn TK ETones SWAP
      
EXAMPLE 3: Initialize graphics in a pre-opened window, loading a rainbow colortable, swap black and white,
# OPEN a canvas window

GUIprefsRead
GUIFrame .plotWin -1 pack|top||both
GUICanvas .plotWin 600 600 600 600

# INITIALIZE graphics

GraphicsOn TK RainBow SWAP .plotWin
      
Feb 19, 2007