GraphDoc.tioga
Sweetsun Chen, December 18, 1985 4:49:23 pm PST
GRAPHDOC
CEDAR 6.0 — FOR INTERNAL XEROX USE ONLY
GraphDoc
Creating, editing, and reviewing graphs
Sweetsun Chen
© Copyright 1985 Xerox Corporation. All rights reserved.
Abstract: Graph is a tool for creating or editing line graphs (x-y charts) manually or programmably. Many convenient functionalities are supported. The first section below contains tutorial steps to help users get familiar with the package easily.
Created by: Sweetsun Chen
Maintained by: Sweetsun Chen <SChen.pa>
Keywords: Graph, Controller, Thyme, Post Processor.
XEROX  Xerox Corporation
   Palo Alto Research Center
   3333 Coyote Hill Road
   Palo Alto, California 94304

For Internal Xerox Use Only
1. Tutorial
It is easy to get familiar with this package, just open this file on-line, and follow the steps in this section.
1.1. [The Graph command]
Issue the following commands in the CommandTool:
% BringOver -p /DATools/DATools6.0/Top/Graph.df
% Graph Simple.list -- a command to plot data in the file, Simple.list.
You would see a Graph viewer created on the color monitor from ascii data in the file Simple.list. Open Simple.list and see what's in there.
Fine point: The Graph viewer would be created on the left (or right) column if you had an entry in the user profile saying: Graph.Column: left (or right, instead of color).
1.2. [The Color menu]
Follow these simple steps below to try with the Color menu.
1.2.1. Click the Color menu, and select the "black and white" entry in the pop-up menu.
-- the graph should become black and white.
1.2.2. Click the Color menu again, and select the "my colors" entry.
-- the graph should resume its original colors.
1.2.3. Now click the same menu and select the "cedar default colors" entry.
-- the whole screen may turn into some kind of grayish color.
1.2.4. Then click the same menu and select the "my colors" entry.
-- the graph should resume its original colors.
This menu is not only useful for you to customize your own colors (see 3.1.1.), but also useful when you are running more than one programs that fiddle the color map. The maps used by these programs may not agree with each other. This menu can be used to resume the desired colors for your graph when another program has changed the color map.
This is why the first entry in the pop up menu is labeled "my colors", instead of "current colors".
1.3. [The Cursor and Background menus]
Try all options with the Cursor and Background menus and see what effects each command listed on the pop-up menus have.
When background is black or dark gray, in order for the axes, ticks, grids, and all black texts to be visible, they are displayed in white.
1.4. [The List menu]
Select the text "Foo" (don't include the double quotes) and click the List menu. A pop up menu would show up asking you to confirm listing the data in the graph into Foo.list. Confirm it by moving the cursor into the only white entry in the pop up menu and click. You will see a viewer opened up and moved to top of its column, displaying the file Foo.list, which contains a listing of the names of the variables in this graph, and a matrix of the x and y values. Are the variables and values the same as those in Simple.list, from which the graph was created? They should be. Now close the listing, or destroy it if you like.
1.5. [The Get menu]
Select the text "Waves" (don't include the double quotes) and click the Get menu. A pop up menu should show up asking you to confirm replacing the graph with "[]<>...>Waves.graph". Now confirm it by moving the cursor into the only white entry in the pop up menu. This menu is similar to the Get menu on a tioga viewer. You will see a different graph displayed in the Graph viewer, and the caption of the viewer is changed, indicating where the data came from.
1.6. [The Merge menu]
Select the text "Simple.list" (don't include the double quotes) and click the Merge menu. Confirm by clicking in the entry showing "[]<>...>Simple.list". This is different from the previous Get menu in that the previous graph remains, and new graph is merged together with the old. The name of the viewer should remain as []<>...>Waves.graph.
1.7. [The Store menu]
Now select "Foo" and click the Store menu. You will see a message in the Message Viewer saying that "Foo.graph" has been written. This file should contain all plotting information currently displayed on the Graph viewer. You might want to verify it by typing the following in the CommandTool
% graph foo.graph
You will see another Graph viewer created with the same curves in it, except that two curves seem to be "missing".
Two curves are missing?
No, in fact they are not. They are not displayed for the following reason. It is often the case that there may be many curves in a graph file. The graph will be too busy, if we always plot all of them out. As you will see in the following sections, it is very easy to show the "missing" curves to the graph or erase plotted curves from the graph. Therefore this program arbitrarily chooses six as the limit for the number of curves to be diplayed initially when a graph file is read.
1.8. [The Controller menu]
Close the new viewer created by the exercise in 1.7., and open Waves.graph to go on from where we were with some other interesting things. Click the Controller menu on the Graph viewer, and you will see the controller's viewer created. There should be two lines of menus on top of the controller's viewer. Below the menus is a "spec" control panel with some bold-faced entry buttons, and some fields following each entries. If you have clicked the Controller menu, destroy the Graph viewer. -- Yes, destroy the graph!
1.9. [The Chart, Spec, Values, Table, and Levels menus]
There are five menus on the first line of menus on the controller, namely, Chart, Spec, Values, Table, and Levels. Click at each of them a couple of times and see what the effects are.
When Chart is clicked, the Graph viewer should be created for you, if it has been destroyed. Otherwise it will show up as the top viewer in its column.
Below the menus can be a spec panel, a values panel, or a table of all texts and curves in the graph. When Spec, Values, or Table is clicked, one of them will show up, replacing the others.
The Levels menu and the third line of menus associated with it are the same as those on a tioga viewer to change the level of display for the table of texts and curves.
1.10. [The Spec panel]
Lets take a look at the spec panel first. (Click the Spec menu on the controller, if the spec panel has disappeared.) There are nine entries on the spec. Each entry has a bold-faced "entry button". Following the entry button are some "fields".
Each boolean field is enclosed by a bounding box. If the color of the text in the box is white on black background, it means that the field value is TRUE; if it is black texts on white background, it means FALSE.
The top five entry buttons are a little different from the other four in that, they don't have a parameter enclosed by parentheses. The parameter is either an index or an id. It is necessary for the latter four entries to have a parameter, because there may be quite a few items associated with each of these entries. For example, there may be many curves in a graph.
1.11. [Showing the spec] - red
Left clicking an entry button, we will see field values in the program's memory for the entry displayed on the panel.
As an exercise, set the id: parameter of the Curve entry to 9, and red-click the Curve entry. It will show the specification for curve number 9, called "Third Y" in your graph.
1.12. [Changing the spec] - control-red
It's simple to change the spec in your graph, too. Lets play with the auto-divisions feature. Click the Auto field in the Divisions: entry so that it shows black letters on white background, meaning FALSE; and set the x: value in the Divisions: entry to 6. With the control key pressed down, red-click the entry button (Divisions:). You will see the number of x divisions on the graph becomes six, as we just specified.
In general, clicking any of the entry button with control-red, will update the values of the associated fields (e.g., the divisions in this example) according to the specified values in the entry on the spec panel.
It is worth noting that, as we can alter the field values at any time, fields values displayed on the spec panel may be different from the current values in the program's memory until you click the entry button with control-red, or red.
1.13. [Adding text or curve] - control-red
We can add new text (or curve) by control-red clicking at the Text (or Curve) entry, if only its id has not been used by any other texts (or curves) already in the program's memory. As an exercise, set the id: parameter of the Text entry to 1, and set the other fields as follows:

Text(
id: 1 ):
name: XEROX
place x: 0 x-justification: left (just click at it) y: 1.1 y-justification: center
color: 3 font: 10 rotation: 0
Check if you have made the right changes as listed above. Now control-red click the Text entry button on the spec panel. You shall see the XEROX logo close to the upper left corner of the graph.
Text's location is relative.
Note that the location of a text is not represented in the same way as all the other things in the graph. It is taking the lower-left corner of the bounding axes as the origin, the width and height of the bounding box as the unit length for x and y. One of the reasons to choose this representation for texts' locations is to make sure that texts won't go away when user changes the bounds for x and y.
Fine point: If you are curious, there was already one "text" in the graph, the title "Waves", with id = 0.
1.14. [Removing text or curve] - blue
The text (or curve) on the graph may be removed by many ways. One of the ways is to use the spec panel. All it takes is to set the text's (or curve's) id in the id: field, and blue-click the entry button. As an exercise, blue click the Curve entry button. What if you red-click at it again?
If the text (or curve) with the specified id has been in the program's memory, but not plotted on the graph, red-clicking at the entry button will plot it out, if its id is specified in the id: field.
1.15. [Integer fields and enumerated fields]
You should have learned how to set the "enumerated" field such as the justification fields for a text. (Recall what you did in creating the XEROX logo.) There is a different "enumerated" field on the spec panel, namely, the mark: field for a curve. Probably by intuition, you will know how to red or blue click at it to change its value.
You can increment (or decrement) an integer field's value (such as an index or an id) by shift-red (or shift-blue) clicking at the field label.
Now try this: if you have red-clicked the Curve entry with id = 9, it should be showing the spec for the curve named "Third Y". Shift-red clicking its color: label to show 12, and click with red or blue at the the mark: label so that its value shows "dollor". Then control-red click the Curve entry button. What do you get?
1.16. [Toggle menus on controller]
We have learned about the spec panel. Now lets take a look at the second line of menus on the controller. They are in fact software toggles. In general, red-clicking any of them turns on the associated feature, while blue-clicking turns it off.
As an exercise, red or blue click the AutoDiv menu a couple of times, and observe the changes on the Graph viewer as well as the spec panel. As another exercise, click the GridX or GridY menus with red or blue button.
1.17. [The Clear / Refresh menu]
If you have removed some curves or grids from the graph, you might have noticed that the remaining curves on the graph are broken. It's OK. We can refresh the graph by the Clear/Refresh menu on the Graph viewer. If you click at it, a pop up menu will show up listing four options.
Select the first option, and observe what it does to the graph.
The second option will do the same thing, but it will clear the screen first. This option is provided in case the graph gets dirty for some reasons. The third option will update the divisions and/or bounds if autoDivision and/or autoBounds are TRUE.
What will the last option do? To see if you are correct, just try it. Yes, try it!
1.18. [The table of texts and curves]
You might have removed all the curves from the graph, I guess. Don't regret, for there are plenty of ways to get your curves back. Now lets go ahead with some other interesting things to try.
Click the Table menu on the controller. Do you see a list of all the texts and curves that were on your graph? Red-click the text "Wave # 1" and see what will happen. What do you think it may happen if you blue-click at it again? -- You're probably right.
How about blue-clicking at the texts on the table? And how about red-clicking at them? Try it.
Isn't it fun?
1.19. [The Values panel]
Use the "skills" you just learned and display all the texts and curves back on the graph. Then click the Values menu on the first line of menus on the controller.
There are two areas on the values panel separated by a thin line. We will talk about the math operations in the first area later. There are two bold-faced buttons in the second area, namely, curve and cross-section.
Red and control-red works on the curve button in a way similar to clicking at entry buttons on the spec panel. As an exercise, set its id: field to 7 and left click the curve button. It should show the (x, y) pairs for the curve number 7 (the "First Y" in your graph). Its x values are 0, 1, 2, 3, and 4, with corresponding y values being 1, 2, 3, 4, and 5. Generally a carriage return is automatically inserted after every four pairs, and a comment is inserted there to tell us which pair the last one on that line is.
Now lets change the y value of the second pair from 2.0 to 2.5, and click at the curve button with control-red. What does it do to this curve on the graph? It is not straight any more.
As to the cross-section buttons, it only takes the red-click command at this time. The result is obvious, so lets skip it.
Fine points: In case you wonder who used the id number 6, it has been used by the x of the second group of curves. The first group of curves are those in Waves.graph, whose x uses the id 0; the second group of curves are those in Simple.list.
1.20. [The keyboard commands on the Graph viewer]
There are quite a few commands on the Graph viewer. Here is an introduction to some of them.
A. select a graph
It's easy to get a Graph viewer's attention, i.e., grab the input focus such that any keys typed won't show up elsewhere in other viewers. Just like for tioga viewers, clicking in a Graph viewer with red or yellow will get its attention. Clicking with red will also show up a cross hair, called "primary caret". Now try it.
B. select a curve
With the key for letter c (as in curve) pressed down, red-click at one of the waves. You don't have to move the cursor right on the curve, the caret should jump to the closest curve it finds.
Many curve-related commands are operated with the c key pressed down for an obvious reason.
C. remove the selected curve
What do you think the key should be for this? Yes, press the c key and click the blue button.
D. select a text
What should be the key? Well, pressing the t key (for text) and red-click inside a text should select it. A text caret will show up at the selected text's location. Note that the legend (or the labels for the ticks on axes) are properties of curves (or bounds), so they are not treated as normal selectable text. Now try to select the text "XEROX". The text caret for "XEROX" should be at the center of its left, because it was left and center justified by you in step 1.13.
E. move selected text
Now with t held down, yellow click at any place you like on the graph. The selected text should be moved there.
The following is a somewhat "advanced" command, to rotate the selected text:
With the t key and any of the "number key" (1..9) pressed down, click red. The text should be rotated for n*10 degrees, where n is the number the "number key" represents. If you click with blue instead of red, the same thing will happen, except that it will be turning clock wise.
F. removing selected text
I believe by now you probably already can guess how to do it. (Yes. t-blue.)
G. switches
The following are some of the keys to turn some of the features on (and off). Try some of them.
b: auto-bound
d: auto-division
ctrl-1, ctrl-2, ctrl-3: turns the primary, secondary, or text caret on (or off).
shift-1, shift-2, shift-3: starts or stops the primary, secondary, or text caret's blinking.
....
H. moving primary caret on curves
You can move the primary caret to any place on the graph by simple red clicking. In addition, there are some commands for you to move it on curves. For example, if you press the s key (for same curve or slide), and move the mouse, the primary caret will try to follow the cursor along the selected curve. (Of course it won't work if no curve is selected. Recall that a curve may be selected by c-red.)
Holding the h (or v) key down and click with red or blue, the primary caret will jump horizontally (or vertically) to another curve. Clicked with red, it will move left (or up); clicking with blue, it will move right (or down). To try it, select one of the "waves". Then holding the h key and click red or blue a few times.
If h (for horizontal) and s (for same curve) keys are both held down when red (or blue) button is clicked, the primary caret will jump to left (or right) to another point on the same curve.
J. for a complete list of the keyboard commands on a Graph viewer, see 4.2.
1.21. [Math operations]
Now lets try some math operations on the curves. (Click the Values menu on the controller, if the values panel has disappeared.) Make sure that the operand: field shows "selected y" in white letters on black background. Select one of the sinusoidal curves, and click abs. (The ABS function.)
Now click at Resume.
Put 2.5 in the argument field, and click at +.
1.22. [Hardcopy]
Now that you have a beautiful graph, you might want to make a hardcopy.
If you click the Interpress menu on the Graph viewer, there will be two options shown up in the pop up menu, namely, color or black-and-white. If you choose color, then it's better to print the interpress master through a color printer, otherwise you may not be able to distinguish curves easily.
Lets make a hardcopy through a black and white printer, say, RockNRoll. Select "Foo" (excluding the double quotes), and click the Interpress menu. Choose black-and-white in the pop up menu, and confirm writing the interpress file Foo.ip. When you see a message saying it's written, type the following in the CommandTool:
% InterpressToPD Foo.pd ← Foo.ip raven384
% print -h rocknroll foo.pd
If RockNRoll is on line, wait a couple of minutes and go to RockNRoll to pick up the hardcopy of the graph.
Just to save the ink (or toner, or whatever) for the printer, the background color is always white for hardcopy, even if the background color is not white on the screen.
1.23. [Programming interface]
Issue the following command in the CommandTool:
% Waves
It will plot something out. If you want to see how simple this graph is created by some simple procedure calls, take a look at the file WavesImpl.mesa. It uses only some of the procedures in the interface called GraphOps. The procedures in GraphOps should be sufficient for most purposes, as far as drawing curves and texts are concerned. More information on the use of these procedures is documented in GraphOps.mesa.
If you are really ambitious, take a look at GraphPrivate, or even every module of the Graph package.
1.24. [Text input]
Open Simple.list. Do you find it very simple? Just list the names of variables, and a matrix of the x and y values, you can make what ever graphs you like. To plot it out, we can use the Get or Merge menus on a Graph viewer; or the Graph command in the CommandTool, as you have practiced.
Of course once we get it plotted, we can change the graph or add new things in it, using the commands or buttons on the Graph viewer and/or its controller.
1.25. [Congratulations]
You have completed this tutorial. Creating customized graphs is very easy for you now. For more information, please read the other parts of this documentation at your leisure.
2. Useful CommandTool commands
2.1. Graph
2.1.1. Command syntax
This package registers a command, "Graph", in the CommandTool to create graphs from files. The command syntax is simply:
Graph {files}
where {files} := one or more instances of [switches] {filePattern}, where switches are optional (see 2.1.2. below), and filePattern may contain "wild" characters (see 2.1.3. below).
If you specify more than one graph files in the command line, the first graph will be shown on the color monitor, and the rest of the Graph viewers will be created initially in iconic state, to be opened later when you like.
This package understands graph files with data written in binary format by clients of this package, such as Cedar Thyme. It also understands graphics data written in ascii texts. See section 7. For backward compatibility, plot files generated by the graphics package previously written for Thyme can also be processed.
2.1.2. Switches:
The meaningful switches are:
-h or -H => (Highest version only. Default TRUE)
Only the highest version of graph files whose names match the filepattern are opened.
-a or, -A => (All versions. Default FALSE)
All versions of graph files that agree with the filepattern are opened.
-# => (The max number of graph files to open is #. Default 12)
Sets the limit of the number of graphs to be opened at a time to #, where # is a number.
A switch affects all files opened thereafter until overridden by a different switch. Illegal switches are ignored.
2.1.3. Examples:
% graph foo*.*
Plots all files with names matching the pattern "foo*.*". For each file that has more than one versions, only the latest version is opened unless the a switch is used. (See example below.) Files with ".press" extensions are automatically ignored.
% graph foo.graph -a cmos*.graph0
Plots the latest version of foo.graph; then plots all versions of files with names matching "cmos*.graph0"
2.2. Commands to make hardcopies
Following are examples of the ways to get hardcopies of the graph in black and white through, say, RockNRoll; or in color through color printers such as the color Versatec plotter. See InterpressToolsDoc.tioga for more details.
2.2.1. Black and white
Suppose the black and white printer you are going to use is Stinger. First make a PD file for it. Suppose you have an IP file named "Foo.ip", and if you want the PD file to be named "FooBW.pd", then the following command will do it for you. Note that the last argument is "raven384".
% InterpressToPD FooBW.pd ← Foo.ip raven384
To print it, just type the following in the CommandTool
% Print -h stinger FooBW.pd
If you had chosen the black and white mode when the interpress master was generated by clicking the Interpress menu on the Graph viewer, you would see the curves plotted in different line patterns (e.g., dots, dashes, etc.); but if you had chosen the color mode, then different curves would be drawn in gray patterns -- which is usually hard for us to distinguish one line from another.
Another black and white printer available in CSL is Stinger (also raven384).
2.2.2. Color
Suppose the color printer of interest is the color Versatec plotter. We can use the "InterpressToPD" command to make a PD file for it from the ip file. Note that the last argument is "colorVersatec". To get a multi-color graph, you should have created the ip file with the color drawing mode.
% InterpressToPD FooColor.pd ← Foo.ip colorVersatec
Then Chat with Sleepy.
If the PD file has been stored on Cherry as
[Cherry]<Thyme>Cedar6.0>Documentation>FooColor.pd,
then send the PD file to Sleepy by issuing the following command on Sleepy in Chat.
>>print [Cherry]<Thyme>Cedar6.0>Documentation>FooColor.pd
See [indigo]<Peach>Documentation>PeachDoc.tioga for more information.
Other color printers available in CSL are: MtFuji (color400) and MtDiablo (c150).
3. User Profile Entries (optional)
3.1. Graph related entries
3.1.1. Graph.Column: {color | left | right} (default: color.)
Specifies the column in which the Graph viewer(s) will be created.
3.1.2. Graph.CreateOption: {CloseOtherViewers | SwapBottomViewer | Iconic | Open} (default: Open.)
This entry specifies how the Graph viewers will be created. If "CloseOtherViewers" is the option, all viewers in the same column will be closed when the Graph viewer is created in that column.
If you choose the "SwapBottomViewer" option, the new viewer will replace the bottom viewer in the column. If there is no viewer in this column, then the new viewer will occupy the whole column.
If Iconic is your option, then the new viewer will be created in its iconic state.
If Open is your option, then simply a new viewer will be be opened.
3.1.3. Graph.Background: {White | Gray | DarkGray | black} (default: White.)
3.1.1. Graph.ColorN: r, g, b
where N may be any number in [1..12], and r, g, b are any real number in [0..1].
If you don't specify your own colors, the default ones are:
Graph.Color1: 1, 0, 0 -- red
Graph.Color2: 0, 1, 0 -- green
Graph.Color3: 0, 0, 1 -- blue
Graph.Color4: 1, 1, 0 -- yellow
Graph.Color5: 1, 0.25, 0 -- orange
Graph.Color6: 0.4, 0, 1 -- purple
Graph.Color7: 0, 1, 1 -- green blue
Graph.Color8: 1, 0, 0.8 -- purple red
Graph.Color9: 1, 0.6, 0 -- orange yellow
Graph.Color10: 0, 0.56, 1 -- greenish blue
Graph.Color11: 1, 0.42, 0 -- yellowish orange
Graph.Color12: 0.52, 1, 0 -- yellow green
In fact you may also alter the following colors (at your own risk) by specifying rgb values for the following colors differently. Note that they are used by the Graph program to display in black and white mode, and to display the background.
Graph.Color0: 1, 1, 1 -- white
Graph.Color13: 0.75, 0.75, 0.75 -- gray
Graph.Color14: 0.25, 0.25, 0.25 -- dark gray
Graph.Color15: 0, 0, 0 -- black
3.2. ColorDisplay related entries
Graph makes use of the ColorDisplay package. Therefore the following user profile entries can be used. If interested, read [Cedar]<CedarChest6.0>Documentation>ColorDisplayDoc.tioga for more information about ColorDisplay.
ColorDisplay.Side: left -- or right, if you like. This is the (logical, rather than physical) side of your color monitor w.r.t. the black and white one.
ColorDisplay.BitsPerPoint: 8 -- or 4, but 8 is recommended.
ColorDisplay.Type: 640x480 -- or 1024x768, depending on your monitor.
4. Graph viewer
4.1. Menus on the Graph viewer:
There are ten menu buttons on each Graph viewer, namely, Color, Curson, Background, Get, Merge, Store, List, InterPress, Clear/Refresh, and Controller. One may click these menus and invoke the associated commands with any mouse button. Most of these menus, when clicked, will pop up a menu listing the options available to the user.
4.1.1. Color - Sets the screen display mode and the color map.
Options:
my colors,
graph default colors,
my colors ← graph default,
cedar default colors,
black and white
There are two screen display mode supported, namely, the color mode, and the black-and-white mode. The first four options are in color mode, while the last one is in black and white mode, in which lines of different colors are represented by different dot-dash patterns.
4.1.1.1. my colors:
This option is useful when you are running more than one programs that fiddle with the color map. This command will resume the right colors for this tool, if other tools have altered the color map.
4.1.1.2. graph default colors:
Display colors according to your default colors. If you have not customized your default colors, the default default colors will be used. The way to cutomize the default colors through user profile is described in paragraph 3.1.1. This option affects the display only, i.e., the current colors setting will still be used when graphs are saved or printed. (See next option.)
4.1.1.3. my colorsgraph default:
This tool keeps a record of the current color setting, which may be set manually by the control panel (see paragraph 5.2.6.) or automatically by reading the specification in a graph file. This command replaces the current color setting with your default setting set through your user profile (see paragraph 3.1.1.). Note that this affects not only the display, but also affects the colors used for printing or saving the graph.
4.1.1.4. cedar default colors:
Use cedar default color map for display. Like 4.1.1.2., this affects display only.
4.1.1.5. black and white:
In the black-and-white mode, curves are drawn in black and white, using different line patterns (dots, dashes, ... , etc.), so that we can still distinguish curves easily when the graph is printed through a black and white printer.
If other tools have altered the color map, you may not see black and white in this mode. In this case, just click the color menu again choosing any of the first three options should put it back in shape -- this won't work if you have altered color # 0 (reserved for white) and/or color # 15 (reserved for black).
4.1.2. Cursor - Sets the color of the cursor on color monitor.
Two options are available: black, or white.
The cursor's color on the color monitor may be black or white. When you click at this menu, a pop-up menu will show up for you to choose its color.
4.1.3. Background - Sets the background color of the graph.
Options: white, gray, dark gray, and black.
There are four colors available for the background, namely, white, gray, dark gray, and black. When you click at this menu, a pop-up menu will show up for you to choose the background color easily.
4.1.4. Get - Gets another graph, replacing the current one.
The current graph on the Graph viewer will be replaced by the new one, whose file name is the current selection. This is similar to the Get menu in a tioga viewer.
The file may be a graph file (generated by this package), a plot file (generated by the graphics package previously used by Cedar Thyme), or an ascii file (see section 7).
4.1.5. Merge - Gets another graph, merging into the current one.
Merge another graph (file name is the current selection) into the current graph.
The file may be a graph file (generated by this package), a plot file (generated by the graphics package previously used by Cedar Thyme), or an ascii file (see section 7).
4.1.6. Store - Stores the graph into a file.
Similar to the store menu command in a tioga viewer, this command stores the plotting information of the graph currently displayed on the Graph viewer into a file, whose name is the current selection.
Note that graph files are created with keep = 10.
4.1.7. List - List the variables and their values of a graph into a tioga viewer in ascii format.
Using the current selection as the name, this command creates a tioga viewer, and list the variables of the graph, and the x and y values of the variables into this tioga viewer. The format is quite simple, see section 7. This list file can be processed by the Graph command in the CommandTool, or the Get and Merge menus on a Graph viewer.
4.1.8. Interpress - Makes a interpress master for the graph.
Options: color, or black-and-white. When this menu is clic+ed, a pop-up menu will show up for you to select one of the two drawing mode: color or black and white.
In the color mode, curves are drawn alternately in twelve colors, which may be customized by the user if he wants. (See paragraph 3.1.1.) In the black-and-white mode, curves are drawn in black and white, using different line patterns (dots, dashes, ... , etc.), so that we can still distinguish curves easily when the graph is printed through a black and white printer.
The name of the interpress file created is simply replacing the "extension" part of the current graph file name with "ip". Note that if there is already an interpress file with the same name, it will be overwritten.
4.1.9. Clear/Refresh - clears and/or repaint the graph.
Options: rebresh, cle`r/refresh, remove all curves. When this menu is clicked, a pop-up menu will show up for you to select one of the three options above.
The first option, refresh, simply repa nts the graph without clearing the display. This is useful when some curves or texts have been erased from the display, erasing part of the curves or texts that still exist. This action is not made automatic whenever something is erased, because refreshing the whole picture may often take a while when the graph is complicated.

The next option, clear/refresh, serves the same purpose, except that the whole screen will be cleared first before the graph is redrawn. This is useful in case the graph gets dirty for some reason.

The third option just removes all the curves from the graph, but the axes, labels, and any texts still remain.
4.1.10. Controller - shows up the controller for the graph.
Each graph can create a controller for the ease of examining and editing the graph. If the controller viewer has not been created, this menu will create it; if it already exists, then the it will be moved to the top of its column.
4.2. Keyboard commands on the Graph viewer:
4.2.1. curves selection and removal.
C-red: select Curve.
C-blue: remove selected Curve.
4.2.2. texts selection, removal, translation and rotation.
T-red: select Text.
T-yellow: move selected Text.
T-blue: erase selected Text.
T-#-red: rotate text by #*10 degrees c.c.w, where # is in [0..9].
T-#-blue: rotate text by #*10 degrees c.w, where # is in [0..9].
4.2.3. show details on control panel.
ctrl-C: show detailed specification of selected Curve on spec panel.
ctrl-T: show detailed specification of selected Text on panel.
4.2.4. switches.
B: switch auto Bounds.
D: switch auto Divisions.
V-X or X-V: switch X target Value bar.
V-Y or Y-V: switch Y target Value bar.
G-X or X-G: switch X Grids.
G-Y or Y-G: switch Y Grids.
4.2.5. moving primary caret (from selected curve to another curve).
H-red: jump left.
 (primary caret jumps Horizontally to the left to another curve.)
H-blue: jump right.
 (primary caret jumps Horizontally to the right to another curve.)
V-red: jump up.
 (primary caret jumps Vertically up to another curve.)
V-blue: jump down.
 (primary caret jumps Vertically down to another curve.)
4.2.6. moving primary caret (on the selected curve).
S-red: Slide primary caret on selected curve.

S-H-red: jump left on Same curve.
 (primary caret jumps Horizontally to the left on the same curve.)

S-H-blue: jump right on Same curve.
 (primary caret jumps Horizontally to the right on the same curve.)
#-red: jump left # steps. (# in [1..9])
 (Primary caret jumps # steps to the left on the same curve.
 Where # may be 1, 2, ... , up to 9. Each data point on the curve is a step.)

#-blue: jump right # steps. (# in [1..9])
 (Primary caret jumps # steps to the right on the same curve.
 Where # may be 1, 2, ... , up to 9. Each data point on the curve is a step.)
4.2.7. other commands relating carets.
1-2 or 2-1: move secondary caret to primary.
ctrl-1: turn on/off primary caret
ctrl-2: turn on/off secondary caret
ctrl-3: turn on/off text caret
shift-1: turn on/off primary caret's blinking
shift-2: turn on/off secondary caret's blinking
shift-3: turn on/off text caret's blinking
4.2.8. refresh/clear.
R: Refresh without clearing
R-C or C-R: Clear then Refresh
shift-C: remove all curves
4.2.9. zooming commands.
Z-red: Zoom in. (if a zoom box has been defined.)
Z-(drag)yellow: define Zoom box.
Z-blue: Zoom out.
4.2.10. selecting Graph viewer.
red: select Graph viewer and move primary caret to cursor's place.
yellow: select Graph viewer.
When a graph caret is selected, the input focus is set to the selected viewer, such that any keys typed on the keyboard will not show up in another viewer. In addition, if carets are set to blink, they will start to do so a couple of seconds after the viewer is selected. They will stop blinking when the viewer is deselected, namely, if another viewer is selected.
5. Graph controller
5.1. Menus on the controller
There are three lines of menus, and the third line may appear or disappear by clicking the Levels menu on the first line.
5.1.1. The first line of menus:
Chart, Spec, Values, Table, and Levels.
5.1.1.1. Chart:
If the Graph viewer doesn't exist, clicking at it will create one; if it already exists, clicking this menu will move it to top of column.
5.1.1.2. Spec:
When this menu is clicked, it will make sure that the spec panel is displayed below the menus.
5.1.1.3. Values:
When this menu is clicked, it will make sure that the values panel is displayed below the menus.
5.1.1.4. Table:
When this menu is clicked, it will make sure that the table of texts and curves is displayed below the menus.
5.1.1.4. Levels:
Similar to the Levels menu on a tioga viewer.
5.1.2. The second line of menus:
AutoDiv, AutoBounds, Xhair1, Xhair2, Slope, TextCaret, TargetX, TargetY, GridX, GridY.
These menu buttons are all switches. Clicking with red button at any of them will turn it on; clicking with blue means turning it off; and clicking with yellow button will pop up an option menu listing the two choices for you to choose. In addition, for Xhair1, Xhair2, and TextCaret menus, if the left or right shift key is pressed down when you click at the menu, it will start or stop the blinking action of the respective carets.
5.1.2.1. AutoDiv:
Automatically choosing the number of divisions on the axes.
5.1.2.2. AutoBounds:
Automatically setting the x and y bounds for the axes.
5.1.2.3. Xhair1:
If shift is not pressed, turn on (or turn off) the primary caret.
If shift is pressed, start to blink the primary caret, or stop it from blinking. Note that blinking action only appears in selected Graph viewer.
5.1.2.4. Xhair2:
Similar to 5.1.2.3., but for the secondary caret.
5.1.2.5. Slope:
Showing the slope between primary and secondary carets on the spec panel.
5.1.2.6. TextCaret:
Similar to 5.1.2.3., but for the text caret.
5.1.2.7. TargetX:
Turn on (or off) the x target value bar.
5.1.2.8. TargetY:
Turn on (or off) the y target value bar.
5.1.2.9. GridX:
Turn on (or off) the vertical grids.
5.1.2.8. GridY:
Turn on (or off) the horizontal grids.
5.1.3. The third line of menus:
FirstLevelOnly, MoreLevels, FewerLevels, AllLevels.
Similar to the tioga menus, to control the level of table entries displayed on the table of texts and curves.
5.2. The spec panel
The spec panel has nine entries to show, update, add, or remove details of the graph.
5.2.0. General features
Each entry starts with a bold faced "entry" button, followed by some "fields" buttons, describing certain specifications for the graph, such as divisions, bounds.
In general, clicking any of these entry buttons with red will display the current graph specification associated with that entry. One can alter its fields values and click the entry button with control-red to set new values for the specifications. If one clicks an entry button with yellow mouse button, a popup menus will show up giving you a list of the choices available for that particular entry.
There are one more funtionality for the Text and Curve entries on the spec panel. If you click the entry button with blue button, the text (or curve) identified by the id in its id: field will be removed from display. If you click with red, it will be displayed on the graph.
Fields with bounding box are boolean switches. If the display style of a boolean switch is white on black, it means true; and black on white means false.
Integer fields such as the id field of Text have the functionality that the field values may be incremented (or decremented) by clicking with shift-red (or shift-blue) mouse button.
Following are a list of the entries on the spec panel.
5.2.1. Divisions - see 5.2.0.
5.2.2. Bounds - see 5.2.0.
5.2.3. Carets - see 5.2.0.
5.2.4. Targets - see 5.2.0.
5.2.5. Grids - see 5.2.0.
5.2.6. Color(index: ) - shows or sets the indexed color.
When the Color entry button is clicked with the red button, the rgb values of the color with index number in the index: field will be displayed. The rgb values are in the range of [0..1]. Although the color index may be any number in the [0..15] range, only those in the [1..12] range are used by curves. It's better not to change colors indexed outside the [1..12] range. This is because color(0), color(13), color(14), and color(15) are used by the Graph package for white, gray, dark gray, and black colors to display background and axes, etc.
5.2.7. Font(index: ) - shows or sets the indexed font, similar to above.
The default fonts are:
indexfamily  bolditalicscreen sizeprint scaleremarks
0  TimesRoman no  no  10    11.0   reserved for labels
1  TimesRoman no  no  8    9.0    reserved for legend
2  TimesRoman yes no  12    13.0
3  TimesRoman no  yes 10    11.0
4  TimesRoman yes no  10    11.0
5  Helvetica  no  no  10    11.0
6  Helvetica  yes no  14    15.0
7  Gacha   no  no  10    11.0
8  Gacha   no  no  8    9.0
9  Hippo   no  no  10    11.0
10  Logo   no  no  14    15.0
11  Math   no  no  8    9.0    reserved to show math chars
5.2.8. Text(id: ) -
5.2.8.1. Displaying a text.
Specify the id of the text in the id: field, and click the entry button with the red mouse button, the specifications (e.g., its content, location, justification, color, font, ... , etc.) of the text will be displayed in the fields following the entry button. If the program finds no text with the specified id, a message will be sent to the message viewer.
5.2.8.2. Changing a text.
One can alter any of the fields in this entry and click the entry button with control-red to change a text, whose id is what's indicated in the id: field.
5.2.8.3. Adding a text
If you do the same as above with an id in the id: field such that the program can't find any text of the same id, a new text will be generated and displayed on the graph. The id field will often be changed to 1 plus the last text id used so far.
5.2.8.4. Removing a text
A text may be removed from the graph, if you specify its id in the id: field of this entry, and click the entry button with the blue button.
5.2.9. Curve(id: ) -
One can display, update, add, or remove a curve with the same methods as described above for texts. In addition, when updating the spec (clicking with control key pressed down), if the shift key is also pressed then the x and/or y values of the curve are also updated according to what's listed on the values panel (described below).
5.2. The values panel
5.3.1. Math operations
With buttons on this control panel, one can perform quite a few math operations on the selected curve or on all curves on the graph, or resume their original values.
Just specify the operand by clicking at the right operand box and click at any of the math functions on the panel. If it is a binary operation, the argument field should also be specified; if it is a triangular function, you have the option to choose degrees or radians for the angle.
Clicking the Resume button will reset the curve (or curves) to their original values when they were first created.
5.3.2. The x-y values of a curve
Clicking the curve button with red, the x-y values of the curve whose id is specified in the id field will be displayed on the panel. Clicking with control-red can update its values. Clicking with yellow button will popup a menu listing these two options for you to choose. Whenever the curve button is clicked, a check mark will be put in the box in front of it, and the check mark in front of the Cross-section button will be removed. There is no other special purpose for this box.
5.3.3. The cross-section
Clicking the Cross-section button with the red mouse button will show the crosssection of all the curves at the particular x specified in the x field. Clicking with yellow will pop up a menu listing this option for you to confirm. Whenever the Cross-section button is clicked, a check mark will be put in the box in front of it, and the check mark in front of the curve button will be removed. There is no other special purpose for this box.
5.2. The table of texts and curves
The table lists all the texts and curves in the program's memory, whether they are currently displayed on the Graph viewer or not. Different levels of entries may be displayed on the table using the levels menus. Each entry on the list is a button to display or remove the associated text or curve on the graph.
5.4.1. Displaying/removing a text.
If any text listed on the table is clicked with the red mouse button, the text will be displayed on the graph; if clicked with the blue button, it will be erased from the graph.
5.4.2. Displaying/removing a curve.
If any curve listed on the table is clicked with the red mouse button, the curve will be displayed on the graph; if clicked with the blue button, it will be erased from the graph.
5.4.3. The Levels menus
If there are only two lines of menus on the controller, we may click the Levels menu on the first line of menus, and the third line of menus will show up. (Clicking the Levels menu again can remove the third line of menus.)
Just like the levels menus of a tioga viewer, we can change the levels of the table being displayed. This is particularly useful to review the simulation data generated by Thyme for a large circuit, which may have several different levels of subcircuits.
6. Basic components of a graph
6.1. Divisions - (x or y)
6.2. Bounds - (x or y)
6.3. Carets - (primary, secondary, or text)
6.3.1. Primary caret
6.3.2. Secondary caret
6.3.3. Text caret
6.3.4. Slope (between primary and secondary carets)
6.3.5. Blinking of carets (blinking only when Graph viewer is selected.)
6.4. Targets - (x or y)
6.4.1. width
6.4.2. color
6.4.3. value
6.5. Grids - (x or y)
6.6. Colors -
6.6.1. index
6.6.2. red
6.6.3. green
6.6.4. blue
6.7. Fonts -
6.7.1. index
6.7.2. family
6.7.3. bold
6.7.4. italic
6.7.5. size of screen font
6.7.6. scale of press font
6.8. Texts -
6.8.1. id
6.8.2. rope
6.8.3. place
6.8.4. x justification
6.8.5. y justification
6.8.6. color
6.8.7. font
6.8.8. rotation (in degrees)
6.9. Curves -
6.9.1. id
6.9.2. name
6.9.3. comment
6.9.4. color
6.9.5. width
6.9.6. mark
6.9.7. group
7. Ascii input
7.1. Introduction
Graphs can be created by writing data in ascii texts in a simple format (described in the next section) then issue the Graph command in the CommandTool, or click the Get or Merge menu on a Graph viewer.
7.2. Format
Variables: <list of names>
[nVars: <number>]
Values: <repetetions of "row"s>
Explanation:
There are three keywords in the format, namely, variables:, nvars:, and values:, meaning the obvious things of a graph. Case doesn't matter for the keywords, but they must be followed by a colon to be distigushed from variables names.
The variables: keyword should be followed by a list of names of all the variables in the graph, with the first being the x variable's name. If a name has some space or delimiting characters in it, double quotes may be used to enclose the name, to make sure that it is taken as a single name.
The nvars: keyword should be followed by a number, specifying the number of variables in the graph. This may be omitted if we already have a list of names. If both variables: and nvars: are specified, they must agree with each other.
The values: keyword should be followed by at least one "row" of numbers. By a "row" we mean a list of values separated by spaces (or some other customary delimiters). The first value in the row should the x value, and the others are the corresponding y values for all the curves. The rows should be listed in the order of ascending x values. (This restriction may be removed later.)
Comments may be put anywhere as in a mesa file. Puntuation marks are reasonably ignored.
If the above simple rules are not followed exactly, Graph may still attempt in any way it can to understand the input and proceed to plot it. It will also try to stop as gracefully as possible, if it finds no way to proceed.
7.3. Example
variables: -- list of the names of variables
"X" "First Y" "Second Y" "Third Y"
values: -- a table of x and the corresponding y values, the first column being the x values.
0.0 1.0 5.0 -0.2
1.0 2.0 4.0 2.0 ;
2.0, 3.0 3.0 1.0
3.0 4.0 2.0 3.0
4.0 5.0 1.0 1.0
8. Remarks
8.1. Comments or complaints
Please feel free to direct any comments or complaints to me. Although hundreds of run-time bugs have been identified and removed so far, the Graph package may still not be robust enough. Please let me know if you have any problems or suggestions about it.
8.2. Changes
Any major changes to this package will be posted on DAToolsUsers^.pa and ThymeUsers^.pa. Please be prepared that some commands or features may be enhanced, altered, or even removed if necessary.
8.3. Caveats
8.3.1. Selecting rotated texts.
Rotated text is selected by moving the cursor into the bounding box of the text with rotation = 0. This will be corrected when time permits, so that the "selecting area" rotates with the text.
8.3.2. Selecting a curve or sliding caret on a selected curve.
When the cursor is far away from the selected curve, it may appear that the caret does not go to the point on the curve closest to the cursor. -- In fact it is indeed the closest point, but it appears not so when the x and y scales are different.
8.3.3. Some legend can't be seen when viewer is narrow.
When there are several viewers on the same column, the size of the viewer may not be large enough to show all legend.
8.4. Features to be added
8.4.1. support log scale
8.4.2. allow choice of any curve as x-variable, and sort them accordingly.
8.4.3. accept spice3 output
8.4.4. ... ... There may be many other nice features to add. Please give me your ideas.
Have Fun Graphing !!