6. Changing the default settings

You may not have realized while going through our simple example that every detail of the graphs that you were creating could be modified. That's because plotdata provides a pretty reasonable set of default settings for things like line widths, character sizes, layout of the graph on the page, etc. However, should you be unhappy with any of these defaults, plotdata allows you to change them. The general method of changing something is the command

PLOTDATA: set parameter value

which has over a hundred different parameters that specify every minute detail of the appearance of the graph, from the frame placement on the page, to the angle of the axis tics. All parameters have names that are no more than six-character long (Fortran experts will recognize the origin of this convention), and an attempt has been made to keep the names logically related. All parameters that are integers begin with n; a set of parameters pertaining to y-axis is identical to the ones for the x-axis with letter y in place of x, etc. For example, nlxinc and nlyinc are the numbers of large x or y-axis increments, i.e. the major divisions of the appropriate axis. Also, the way of modifying all parameters is exactly the same: if you specify parameter but not the new value, the current value is reported, you are prompted for the new one, and entering a carriage return alone retains the old value. In addition, all parameters that define length or size of something can be specified in graph units or in percent of the page size; you choose the latter by prepending % to the parameter name.

Some useful examples:

set %xlaxis 18
Modifies the placement of the lower end of the x-axis on the page, here at 18% of the total page width from the left edge. The default value is 15%, and if you have a complex axis' label with subscripts and superscripts you may want to leave a bit more room for it.

Other parameters in this ``family'': xuaxis, ylaxis, and yuaxis.

set nlxinc 5
Specifies the number of the large (major) divisions of the x-axis. See also nsxinc, the number of small (secondary) tics inside each major division; also nlyinc and nsyinc. The default values depend on the range of the data.

set %charsz 2
Modifies the size of the plotting character (pchar). Similarly, xnumsz and ynumsz refer to the size of the numbers at the tics of the axes; xlabsz and ylabsz to the size of the text of axis labels; txthit to the height of general strings of text that can be placed at arbitrary locations on the graph using the command text.

set xtica 90
and set ytica -90 will ``flip'' the axis tics to the inward direction, opposite to the default outward one. The angle is specified relative to the direction of the respective axis, and need not be +/-90 degrees. Similarly, the angle of the text's text string is determined by txtang.

set lintyp 9
Selects the line type for the next graph command. There are 10 predefined types (use display lines to see what they are) and user-defined line types can be created.

set box 0
Turns off the axis box. Many parameters have only two values, on (=1) and off (=0). The most frequently used ones are: xaxis and yaxis which control whether the appropriate axis is drawn at all; xcross and ycross which force the axis zero-crossing to be shown on the graph; there are many others.

set menu
Presents the list of all possible parameter names and their current values. The list is long and wide; it may wrap lines on your screen and scroll a couple of pages by, but it's all there!

One comment: several set commands can be combined together, like this:

PLOTDATA: set
Enter: name { value } >> %xlaxis 18
Enter: name { value } >> %xuaxis 95
Enter: name { value } >> box 0
Enter: name { value } >> lintyp 7
Enter: name { value } >>
PLOTDATA:

with a blank line at the end terminating the current set command. In a macro file, of course, you would not enter the text of the prompt Enter: >>, but a blank line to terminate a multiple set command would still be needed.

There are a few commands that affect the settings, but are important enough to deserve their own plotdata command. We have already seen pchar; in a similar category is scales command which allows you to specify explicitly the x and y-axis scales and number of divisions on each (plotdata defaults to scales that include all of the data, and determines an appropriate number of divisions automatically; most of the time it does a pretty good job). In principle, you could achieve the effects of a single scales command with a series of set commands, explicitly changing such parameters as xauto, xmin, xmax, nlxinc, nsxinc, nxdig, nxdec, etc., but this is much less convenient. For more information, try help scales.


Up: Table of contents Next: 7. Surfaces, contours, and other 3D plots Previous: 5. Generating your own data