If the file argument is given, layout simulates a Layout operation (see below) to load the named file, so that it can be edited.
If the -p option is specified, the file argument must be given. Layout will read this file, then perform the equivalent of a Plot/File operation, with the Plot/All-graphics option set (both described below), sending the HPGL code to the standard output. It then quits. The generated output can be redirected to a file, or piped to hardcopy. This allows you to quickly plot out a completed layout file, without getting into layout's editing mode.
If the -u option is specified, the file argument must be given. Layout will read this file, then perform the Use operation (also described below), then quit. This allows you to quickly specify which layout file you wish to use, without getting into layout's editing mode.
With either the -p or -u option specified, you can give the file name as simply -, and layout will read the layout file from its standard input. This allows you to pipe a layout file to be plotted or used, without requiring a temporary file.
If the -p and -u options are not specified, layout enters its editing mode, which allows you to add, delete and change panels. A layout file may contain up to 256 panels. When displayed on the screen, a number appears in the bottom-left corner of each panel. These numbers indicate the order in which the panels will be used; it is possible to change this order. An arrow also appears in each panel, indicating the orientation of the graph which will be plotted in this panel. At the bottom of the display, layout prints the following menu prompt line:
An operation is initiated by typing a single letter, the first letter of an item in the menu line. You can also step through the menu using the space bar and the backspace (or erase) key, to highlight the item you want, then press RETURN to select that item.
Fine adjustments may be made to the position of the last corner selected (or of the origin, initially) by using the keys "^", "v", "<", or ">" for up, down, left, or right movement in single grid increments (see below), respectively. The arrow keys on the editing keypad of the terminal may be used as well. The last position adjustment can be undone by using the U key.
You can also set both corners of the panel to be identical to those of another existing panel, by using the # key. You will then be prompted for a panel number. Entering a valid panel number causes the current panel's corners to be set to those of the specified panel. You could then use button A to move the panel to a different position, keeping the size constant.
As you adjust the position of either corner, the top status line is updated to indicate the new position of each corner, either in millimetres or as a percentage of the usable page size. Typing the % key will toggle the status display between these two units of measure.
Initially, panel bounds may be adjusted in increments of one plotter unit, or one 40th of a millimetre. Typing the + key allows you to set up a "grid" of a lower resolution, to facilitate alignment of panels to a particular spacing, by specifying the grid spacing in millimetres. Subsequent adjustments of the panel bounds will be aligned to an invisible grid of the given spacing. Specifying a grid spacing of less than 0.025, such as 0, will reset the grid spacing to 0.025 millimetres, i.e. plotter units. Larger grid spacings are rounded to the nearest multiple of 0.025.
Press button C or D when you are done, to go on to the next panel. To stop adding panels, and return to the main menu, press button C or D again, before setting either of the corners. This operation also will terminate once all 256 panels are created.
Another way of initiating a change operation is to point to a panel with the pointing device, and click one of its first two buttons. (This can only be done when the display is in the "panel view" mode, and the program is waiting for you to make a menu selection.) You then set the bottom-left and top-right corners, as for the Add operation above. Press button D once when you are done, to return to the menu.
The Empty operation does not delete labels that were added by the Text/Add, Text/Copy or Text/Grab-text operations, if any exist in the panel. These labels are independent of the plot file attached to the panel, and can be removed using the Text/Delete operation.
Note that the plot file is not loaded into the current layout; the name of the file is simply stored for future access. Thus the plot file should not be renamed, moved, or removed without making the corresponding change to any panel that refers to the file.
You are prompted to enter the name of the layout file to be edited. Type in the name, then hit RETURN. If the file is a valid layout file, its panels will be displayed. If you specify the name of a file that does not exist yet, the top line of the display will indicate that this is a new file, and you will start with a clear page of a default size, usually A-size, just as you do when you invoke layout without a file argument.
When plotting on large sheets of paper, the HP 7550A plotter rotates in the counter-clockwise direction, rather than clockwise. Use the Set-page operation to tell the layout program which page size you are using; rotated panels will then appear top edge left for large sheets.
The first four selections set P1 and P2 to the plotter's defaults for that size of paper. The panels will be rescaled to fit within these bounds, and the panels will be redisplayed.
The P1-P2 selection allows you to specify values for the HP plotter's P1 and P2 different than those available for standard page sizes. You are prompted to enter, one at a time, the P1 X and Y coordinates, then the P2 X and Y coordinates. If, for any of these, you just hit RETURN without entering a number, the current value (shown after the cursor in the prompt) will be used. Typing a control-D will cause this operation to terminate, without changing anything. Once all four numbers have been entered, the panels will be rescaled to fit within the new P1 and P2.
The Margins selection allows you to enable or disable the "margin restriction" option. When this option is enabled, as it is initially, the setting of panel bounds (by means of the Add or Change operations above) is restricted to the area defined by the current P1 and P2 values. If you try to set a panel corner outside of these margins, it will be set to the nearest margin. By disabling this option, panels bounds can be set freely outside of the margins, or even outside of the hard-clip limits. When this option is changed, the screen is redrawn: when disabled, the page is reduced on screen to allow panel bounds to be set outside of the hard-clip limits; when enabled, the page is expanded to fill the drawing area on screen.
The Resize selection allows you to resize all panels simultaneously (as is done automatically whenever you change P1 and P2), but without changing the current P1 and P2. When this operation is selected, a temporary panel is created, with its bounds set to the current P1 and P2. You are then allowed to move or resize this panel, as for the Change operation above. Once you finish changing this panel, by pressing button D, all other panels will be resized and moved proportionally, and the temporary panel will be deleted. The panels will then be redisplayed.
The Quit selection returns you to the main menu, without changing P1 and P2.
Note that if the Plot/All-graphics option is not currently set, a subsequent Plot/File or Plot/Plotter operation will produce a plot of this panel, rather than all panels, unless you perform another View/Graphics, View/Panels or View/Both operation, or set the Plot/All-graphics option, before plotting.
A file is created, which controls the operation of the spooler. Once hardcopy(1) has been called enough times to use up all panels in the layout, this control file will be automatically removed, and hardcopy will revert to its normal mode of operation. If you want to reuse the same layout again, or use any other layout, this operation will have to be repeated. (Or you will have to invoke layout with the -u option.)
If this control file already exists at the time this operation is selected, you will be asked if it is OK to replace it. Type a Y to replace the control file, or an N to abort this operation, leaving the control file unchanged. One control file is permitted for each user-tty combination.
This operation exists for reverse compatibility with earlier versions of layout and may not be supported in future versions.
The graphics are drawn on screen by emulating the HPGL stored in the attached plot files. Only a small subset of the full HPGL is emulated, which is adequate for handing output from programs like analysis(1). Text is drawn as a series of line segments, using the "roman" Hershey font by default. The font can be changed by setting the environment variable VFONT to the name of any of the variable size fonts in the directory /usr/neuro/lib/font. Pen selections affect drawing colour, according to the environment variable SCRPENS, a comma-separated list of CNS names corresponding to each pen's colour.
Because of the limitations of the on-screen emulation, a valid plot file may look incomplete or incorrect on screen; however, the completed layout should be correct when plotted on a true HPGL device.
Note that the currently displayed view also affects a subsequent Plot/File or Plot/Plotter operation, if the Plot/All-graphics option is not currently set.
The information is then written out to the file, which will be created if it does not exist. If there are any errors in accessing the file or writing out the data, a message will be printed.
There are two approaches you can take to edit the labels for a panel. You can begin with an HPGL plot file that contains only graphics, and no text labels. You can then add labels, one at a time, and place them at the desired locations over the displayed graph. For simple graphs that don't require many labels, this is quite acceptable and fairly simple.
The other approach is preferable when you want to modify a graph with several labels, or when you only want to make simple changes to the labels of a graph. You can begin with a plot file that contains both graphics and text labels. You then perform a Grab-text operation on the panel, as described below. This copies the labels from the HPGL plot file into the current panel of the layout file, so that you can edit them, resize them, and so on. It also sets the "ignore text" option for this panel, so that the old labels, which are still in the HPGL plot file, will not be displayed or plotted.
A new menu is presented, allowing you to add and change labels, and modify various label parameters. The choices are:
Selections are made by typing the first letter of an item in this menu.
Many of these operations require that you first select one or more labels to be modified, before you select the operation from the menu. You can do this, while at the menu, by pointing to individual labels with the pointing device, and clicking one of its buttons. Clicking button A will unselect all other labels, and select only the one to which you are pointing. Clicking button B will select the label to which you are pointing, if not already selected, or unselect it otherwise. When labels are selected, boxes appear around their text, and a small diamond-shaped marker indicates the origin of each selected label. Clicking both buttons A and B, simultaneously, will select all labels in the panel. Clicking button A, when you are not pointing to any label, will unselect all labels.
When labels overlap, even partially, the label selected by pointing and clicking may not be the one you want. Layout always selects the most recently created label when the cursor points to more than one label. (You can consider this label to be in "front" of the others.) The "front to back" order of labels can be changed by using button C, to move all currently selected labels to the "back" and unselect them, before selecting a new label from the front. If there are no labels currently selected, button C is equivalent to button A.
You can also hold down one of these buttons, and drag the pointing device along. An expanding box will appear, from the point where you started, up to the current cursor position. When you release the button, all labels surrounded by the box will be selected. If you started by holding down button A, only these labels are selected; any others are unselected. If you started by holding down button B, these labels are selected in addition to any others already selected. Button C is equivalent to button A, except that previously selected labels are moved to the back before being unselected.
Deleted labels are placed into a temporary buffer, called the paste buffer. Only labels deleted by the last Delete operation are kept in the paste buffer; previous deletions are then lost. The Undelete operation, below, allows you to retrieve the current contents of the paste buffer.
If you select one of these parameters from the menu, and have not selected any labels in the panel, you are prompted for a new default value for the parameter, to be used by the next Add operation.
The Alternate selection allows you to set the "alternate character set number" for the labels. This is not needed unless the label contains SI and SO characters to change character sets. (Alternate character sets are supported by the HP plotters, but not by the HPGL emulator.)
The Chord selection allows you to set the "chord angle" used to draw curved characters in the HP 7550A plotter's built-in proportionally-spaced characters sets.
The Direction selection allows you to set the label direction in degrees. A direction of 0 is the normal left-to-right direction. Note that the label direction can also be changed, in 90 degree increments, using the Text/Rotate selection.
The Initial selection allows you to specify whether labels should begin with the alternate character set, rather than the standard one. This option is usually not needed, and should normally be left disabled.
The Name selection allows you to select the name of a Hershey font to be used to draw out the text of the labels. If you select one of these Hershey fonts, it will be used both on-screen and on the plotter, to display characters as a series of line segments. If you enter a hyphen (-) instead, the default font is used. The default font is the built-in font for the plotter, or the default Hershey font (as described for the View/Graphics operation above) for on-screen emulation. When selecting a Hershey font, it is a good idea to also set the "standard character set number," described below, to 10, to select proportional spacing.
If the Hershey font name is preceded by a plus sign (+), the character spacing, height, and width will be optimised for horizontal and vertical centering of the character; this can be useful when labels are used as marker characters on a graph. If the font name is preceded by an asterisk (*), the text will be thickened - plotted several times, offset slightly each time both horizontally and vertically - to get more solid characters than usual. This is useful when using the multiple stroke character fonts, in large sizes, since it will fill in the gaps. Note that it also will greatly increase plotting time, as the label size increases (a doubling of label width will quadruple the number of times the label is plotted).
Font files can be in either binary or text format. If a binary version of a particular font exists, it is loaded; otherwise, the text version is loaded and converted to binary. The size, in binary format, is currently limited to 20K per font. The Hershey fonts currently available are:
compgr complex Greek compit complex italic compro complex roman compsc complex script cyrillic complex Cyrillic duplex duplex roman gothen Gothic English gothgr Gothic German gothit Gothic Italian greek simplex Greek roman simplex roman script simplex script special special characters (symbols) special2 more special characters symbol other symbols triplit triplex italic triplro triplex roman
For all the fonts above, except for compgr, cyrillic, greek, special, special2, and symbol, the character set roughly corresponds to standard ASCII. There are also versions of these fonts corresponding to the HP Roman 8 character set, and the ISO 8 bit set with the Latin 1 extensions. These can be specified by adding the suffixes -r8 and -i8 for Roman 8 and ISO 8, respectively, to one of the above font names. For example, roman-i8 specifies the simplex roman font with the ISO Latin 1 extensions. There is also one Katakana font, roman-kt, which follows the JISX0201 (1976) Katakana encoding; it contains simplex roman characters in the bottom half (ASCII-encoded), and simplex Katakana symbols in the upper half.
The Oblique selection allows you to set the slant angle for labels. Positive values give a forward slant, and negatives give a backward slant.
The Standard selection allows you to set the "standard character set number" for the labels. The two most commonly used values for this are 0, to get the standard ASCII fixed-spaced character set, or 10, to get the standard ASCII proportionally-spaced character set (on the HP 7550A). Other sets can be used on the plotter, but when Hershey fonts are used, only one character set exists for each font file, and this parameter simply determines whether spacing will be fixed or proportional.
When the "ignore text" option is set, you can't perform another Grab-text operation on the panel. This is to prevent accidental extraction of labels, once you have already done so. You can circumvent this by temporarily disabling this option, then repeating the operation, but you should first delete all labels that would get in the way.
In either case, when you press button A, the box that surrounds the label or labels is moved to the current cursor position. As long as the button is held down, you can drag this box around on the display. When you release the button, the label or labels move to the new position of the box. Pressing button B has a similar effect, but the box is moved from its current position only in the X direction or only in the Y direction, whichever displacement of the cursor is larger.
Fine adjustments may be made to the position of selected labels by using the keys "^", "v", "<", or ">" for up, down, left, or right movement in single grid increments (see below), respectively. The arrow keys on the editing keypad of the terminal may be used as well. You can undo the last change in position, while in the Move operation, by typing the U key.
As you move labels, or drag the box around, the top status line is updated to indicate the new position of the label origin, either in millimetres or as a percentage of the panel size. Typing the % key, while in the Move operation, will toggle the status display between these two units of measure.
Initially, label positions may be adjusted in increments of one plotter unit, or one 40th of a millimetre. Typing the + key allows you to set up a "grid" of a lower resolution, to facilitate alignment of labels to a particular spacing, by specifying the grid spacing in millimetres. Subsequent adjustments of the label origin will be aligned to an invisible grid of the given spacing. Specifying a grid spacing of less than 0.025, such as 0, will reset the grid spacing to 0.025 millimetres, i.e. plotter units.
Press button C or D when you are done, to return to the Text menu.
The Left, Centered and Right selections change the horizontal alignment of selected labels about their origins. The Bottom, Mid-height and Top selections change the vertical alignment of selected labels about their origins. The Outside selection will move the label text away from its origin, by some small amount. Inside selection will move the label text right back beside the origin. These last two selections have no visible effect on centered, mid-height labels.
The Number selection will prompt you for the label origin code used by the LO instruction in HPGL (for the HP 7550A). The current setting for this parameter appears as the default value in the prompt, as long as all selected labels have the same current value. If you enter a new value, this value is applied to all selected labels.
The Float and Hold selections will modify the way the program changes the label origin when using the above selections. By default, the label will float around a fixed origin marker, as described above. If you ask the program to hold the label, then the text will remain in place as the origin marker moves around the label. This is useful for graphs imported from other software packages, which don't set the label origins: you can hold a label, or several, in position then set the origin as desired, so that any later change in label size will make the text grow or shrink in the direction you want.
If you have not selected any labels in the panel, any of the label origin operations above will change the default label alignment for the next Add operation.
If you have not selected any labels in the panel, this operation will change the default pen number for the next Add operation.
If you select one of these parameters from the menu, and have not selected any labels in the panel, you are prompted for a new default value for the parameter, to be used by the next Add operation.
The Height selection allows you to set the character height for the labels. It corresponds approximately to the height of capital letters. The Width selection allows you to set the character width for the labels. It corresponds approximately to the width of the capital letter X. These parameters are entered in millimetres, but are maintained as factors of the panel's height and width. If you change the size of the panel, or select a different page size, the character height and width are adjusted accordingly, to keep the same text proportions in the panel. For the Hershey fonts, best results are obtained when the width is 5/7ths of the height.
The Spacing selection allows you to set the extra spacing factor for the labels. This is entered as a factor, usually less than 1, which determines the extra spacing to insert between characters. (The actual amount of space will be this factor times 150% of the label's character width.) A small negative factor will tighten up the spacing, rather than increasing it.
You can use this operation to paste labels into the current panel, that had been deleted from another panel. If the two panels have different sizes, or different proportions, the labels will keep the same actual size as they had in the other panel, rather than the same proportions relative to the panel sizes. However, the placement of labels will be maintained relative to the panel dimensions. This may pose a problem with alignment of labels when you paste several labels in a panel of a different size.
As labels are moved around on the display, they can overlap with and erase parts of the graph or parts of other labels. Also, if they overlap with the selection boxes or origin markers of other labels, they can cause parts of these boxes or markers to remain on the display after they are erased. A View operation will clean this up by redrawing everything.
Selections are made by typing the first letter of an item in this menu.
Line segments and boxes added by the Box-draw and Draw-line operations below are treated much like text labels. The Copy, Delete, Font/Direction, Move, Pen, Rotate, Size, and Undelete operations described above can all be applied to these graphics.
Additional boxes may now be drawn by again pressing a button and dragging the cursor. Beginning a new box by pressing button B will cause the origin of the new box to be set to the position of the opposite corner of the last box, rather than the cursor position. When you are finished drawing boxes, pressing button D will return you to the menu. Pressing the % and + keys accomplishes the same thing as in the Change and Text/Move operations.
Additional line segments may now be drawn by again pressing a button and dragging the cursor. Beginning a new line segment by pressing button B will cause the origin of the new line segment to be set to the position of the end point of the last line segment, rather than the cursor position. When you are finished drawing boxes, pressing button D will return you to the menu. Pressing the % and + keys accomplishes the same thing as in the Change and Text/Move operations.
Selecting X-flip inverts the X coordinate of all selected labels, resulting in a "mirror-image" flip along a centered vertical axis. Selecting Y-flip inverts the Y coordinate of all selected labels, resulting in a "mirror-image" flip along a centered horizontal axis. Selecting Both inverts both the X and Y coordinates, resulting in upside-down labels.
Selecting All results in all boxes, lines, and text labels being selected. Boxes will select all boxes in the panel. Lines will do likewise for all line segments. Graphics will select all boxes and all line segments. Text will select all text labels in the panel.
Selecting a digit in the range 0 to 6 will set the line type to solid, dotted, dashed, long-dashed, dashed/dotted, long/short-dashed, or long/short/short-dashed, respectively. Selecting Edit will result in a prompt allowing you to set or change the line type specification, used by the HPGL LT instruction, for the selected lines and boxes. If only one graphic is selected, or if they all have the same line type, the prompt will show the current line type as the default.
Selections are made by typing the first letter of an item in this menu.
When plotting, whether to a file or to the plotter, layout will plot each panel in order of panel number. For a given panel, it will first plot out the content of the attached plot file. This is followed by all line segments, boxes, and text labels using the plotter's built-in font, in order of pen number. Finally, text labels using Hershey fonts are plotted, also in order of pen number.
Because of this last constraint, completed layouts that are saved as plot files, by selecting Plot/File above, can not then be plotted within a panel of a subsequent layout.
In order to perform a Text/Grab-text operation on a panel, the attached plot file must contain label instructions (LB, or BL and PB). Without these, layout will not be able to extract the label text from the file.
As for most other X Window programs in this package, the following X command line options are accepted:
When you tell layout to suppress the plotting of text in a graph, either by disabling the Plot/Text option, or by enabling the Text/Ignore option for one or more panels, it will plot the files in question by passing them through the HPGL emulator, rather than passing them directly to the output. Because of this, the limitations in the HPGL emulation can affect plotter output. This should not be a problem when using plot files generated by the Spinal Cord Research Centre's data capture and analysis software, but may cause problems if using HPGL plot files obtained from other sources.
Because layout reinitialises the plotter before plotting each panel in the layout file, any instructions you send to the plotter beforehand to set various plotting parameters (like VS, FS, or AS) will have no effect. To get around this problem, you can set the environment variable HPGLINIT to the string of HPGL commands you want performed after an IN instruction. This string will be sent to the plotter for each panel plotted.