PlotColor TCL UTILITIES USER MANUAL PlotColor
SYNOPSIS
Set current active plot color and line style
PACKAGE
TCLGPH
NAME
PlotColor
USAGE
PlotColor  lStyle lColor fColor
INPUT DEFINITIONS
lStyle - The current line style. This can also set in the LineStyle procedure and is also included here for historical reasons. The recognized inputs are:
SOLID - Solid line
DASH1 - Short dashes, short gaps
DASH2 - Medium short dashes, short gaps
DASH3 - Medium long dashes, short gaps
DASH4 - Long dashes, short gaps
SPDASH1 - Short dashes, medium gaps
SPDASH2 - Medium short dashes, medium gaps
SPDASH3 - Medium long dashes, medium gaps
SPDASH4 - Long dashes, medium gaps
DASHDOT1 - Medium short dash, dot; short gaps
DASHDOT2 - Medium long dash, dot; short gaps
DASHDOT3 - Long dash, dot; short gaps
DASH2DOT1 - Medium short dash, dot, dot; short gaps
DASH2DOT2 - Medium long dash, dot, dot; short gaps
DASH2DOT3 - Long dash, dot, dot; short gaps
DASHSPDOT1 - Medium short dash, dot; medium gaps
DASHSPDOT2 - Medium long dash, dot; medium gaps
DASHSPDOT3 - Long dash, dot; medium gaps
HOLD - Keep current line style
In addition to the above hard coded patterns, lsytle may also contain a user defined line style.
lColor - The current line color. Value must be between 0 and 255. Set to HOLD to keep the current value. When fColor is set this is the color which outlines the filled area. Set to the fcolor value if you don't want to see the outline.
fColor - The current fill color. Value must be between 0 and 255. Set to OFF to turn off filling or set to HOLD to keep the current value.
RETURN DEFINITION
NONE
DESCRIPTION
PlotColor sets the current line style, the current line color, and the current fill color. There are multiple predefined line styles. In addition you can create your own line styles. This is done by passing in a string of the form "{???}" where ??? is a series of characters made up from [. , - _ sp] (where sp is a space). In the series . represents a dot or small dash, , is a medium small dash, - is a medium large dash, _ is a large dash, and space is a space. The line style made up of the sequence "{_..}" is series of long dashes followed by two dots.
lColor is the current line color. With the exception of text, all output will be drawn with this color. The color is given as a value between 0 and 255 which is an offset into the color look up table. The elements White, Red, Yellow, Green, Cyan, Blue, Purple, and Black in the global variable can be used to specify colors. The names however are specific to the RainBow color table. With the exception of Black and White using them with other color tables may give colors which do not match the names.
fColor is the current fill color. When this is set all polygons will be drawn filled with this color. If the polygon is not to be filled then set this color to OFF. When drawing a filled polygon the polygon will be outlined in lcolor. To keep the polygon filled in a single color set lcolor to fcolor.
ERRORS
None Generated
C BACKING
No
EXAMPLE(S)
EXAMPLE 1: Show line styles and examples of filled polygons.
# INITIALIZE the default gui settings

GUIprefsRead

# SET a window size

set GphInfo(xsScrL) 600
set GphInfo(ysScrL) 500
set GphInfo(xScrL) 600
set GphInfo(yScrL) 500

# START graphics

GraphicsOn TK RainBow 

# ESTABLISH a graphics window coverting the whole canvas 

GenWindow 0 0.0 0.0 0.0 1.0 1.0 1.0 -6.0 -6.0 0.0 6.0 6.0 0.0

# SET the text size to 10

TextProp 10 HOLD HOLD

# OUTPUT lines of different line styles and label them

PlotColor DASH1 $GphInfo(White) HOLD
Line 0  -6.0 5.0 0.0 2.5 5.0 0.0
TexT 0 3.0 5.0 0.0 right DASH1 $GphInfo(White) 

PlotColor DASH2 $GphInfo(White) HOLD
Line 0  -6.0 4.5 0.0 2.5 4.5 0.0
TexT 0 3.0 4.5 0.0 right DASH2 $GphInfo(White) 

PlotColor DASH3 $GphInfo(White) HOLD
Line 0  -6.0 4.0 0.0 2.5 4.0 0.0
TexT 0 3.0 4.0 0.0 right DASH3 $GphInfo(White) 

PlotColor DASH4 $GphInfo(White) HOLD
Line 0  -6.0 3.5 0.0 2.5 3.5 0.0
TexT 0 3.0 3.5 0.0 right DASH4 $GphInfo(White) 

PlotColor SPDASH1 $GphInfo(Red) HOLD
Line 0  -6.0 3.0 0.0 2.5 3.0 0.0
TexT 0 3.0 3.0 0.0 right SPDASH1 $GphInfo(Red) 

PlotColor SPDASH2 $GphInfo(Red) HOLD
Line 0  -6.0 2.5 0.0 2.5 2.5 0.0
TexT 0 3.0 2.5 0.0 right SPDASH2 $GphInfo(Red) 

PlotColor SPDASH3 $GphInfo(Red) HOLD
Line 0  -6.0 2.0 0.0 2.5 2.0 0.0
TexT 0 3.0 2.0 0.0 right SPDASH3 $GphInfo(Red) 

PlotColor SPDASH4 $GphInfo(Red) HOLD
Line 0  -6.0 1.5 0.0 2.5 1.5 0.0
TexT 0 3.0 1.5 0.0 right SPDASH4 $GphInfo(Red) 

PlotColor DASHDOT1 $GphInfo(Green) HOLD
Line 0  -6.0 1.0 0.0 2.5 1.0 0.0
TexT 0 3.0 1.0 0.0 right DASHDOT1 $GphInfo(Green) 

PlotColor DASHDOT2 $GphInfo(Green) HOLD
Line 0  -6.0 0.5 0.0 2.5 0.5 0.0
TexT 0 3.0 0.5 0.0 right DASHDOT2 $GphInfo(Green) 

PlotColor DASHDOT3 $GphInfo(Green) HOLD
Line 0  -6.0 0.0 0.0 2.5 0.0 0.0
TexT 0 3.0 0.0 0.0 right DASHDOT3 $GphInfo(Green) 

PlotColor DASH2DOT1 $GphInfo(Cyan) HOLD
Line 0  -6.0 -0.5 0.0 2.5 -0.5 0.0
TexT 0 3.0 -0.5 0.0 right DASH2DOT1 $GphInfo(Cyan) 

PlotColor DASH2DOT2 $GphInfo(Cyan) HOLD
Line 0  -6.0 -1.0 0.0 2.5 -1.0 0.0
TexT 0 3.0 -1.0 0.0 right DASH2DOT2 $GphInfo(Cyan) 

PlotColor DASH2DOT3 $GphInfo(Cyan) HOLD
Line 0  -6.0 -1.5 0.0 2.5 -1.5 0.0
TexT 0 3.0 -1.5 0.0 right DASH2DOT3 $GphInfo(Cyan) 

PlotColor DASHSPDOT1 $GphInfo(Blue) HOLD
Line 0  -6.0 -2.0 0.0 2.5 -2.0 0.0
TexT 0 3.0 -2.0 0.0 right DASHSPDOT1 $GphInfo(Blue) 

PlotColor DASHSPDOT2 $GphInfo(Blue) HOLD
Line 0  -6.0 -2.5 0.0 2.5 -2.5 0.0
TexT 0 3.0 -2.5 0.0 right DASHSPDOT2 $GphInfo(Blue) 

PlotColor DASHSPDOT3 $GphInfo(Blue) HOLD
Line 0  -6.0 -3.0 0.0 2.5 -3.0 0.0
TexT 0 3.0 -3.0 0.0 right DASHSPDOT3 $GphInfo(Blue) 

PlotColor "{_....}" $GphInfo(Yellow) HOLD
Line 0  -6.0 -3.5 0.0 2.5 -3.5 0.0
TexT 0 3.0 -3.5 0.0 right "USER DEFINED" $GphInfo(Yellow) 

# DRAW a red filled box outlines in yellow

PlotColor SOLID $GphInfo(Yellow) $GphInfo(Red)
Box 0 3.0 -5.5 0.0 4.0 -4.0 0.0

# DRAW a purple filled box outlines in purple

PlotColor SOLID $GphInfo(Purple) $GphInfo(Purple)
Box 0 -4.0 -5.5 0.0 -3.0 -4.0 0.0

# DRAW a solid green line

PlotColor SOLID $GphInfo(Green) OFF
Line 0 -2.75 -4.75 0.0 2.70 -4.75 0.0
TexT 0 0.0 -4.75 0.0 center "SOLID" $GphInfo(Green) 
      
Feb 15, 2007