Graphics Resources
This describes some of the standard characteristics of all graphical output.
Draw Resource
The draw resource is used to toggle on and off various parts of the plot. The plot contains two basic regions. The text label areas above and below the plot and the plot itself. The text labels can appear in six regions around the plot, left, center and right. The plot contains a background map or grid and the data plotted as text, symbols or contours. There is a plot border which is a rectangle surrounding the plot. The other possibility is the radar summary that is separate from data. There are these possible options for draw:
- text - The text labels above and below the plot (all labels and border)
- text_ul - The text label in the upper left
- text_uc - The text label in the upper center
- text_ur - The text label in the upper right
- text_ll - The text label in the lower left
- text_lc - The text label in the lower center
- text_lr - The text label in the lower right
- bord - The plot border
- map - The background map
- grid - The background grid (synonymous with map)
- data - The data plotted as text, symbols or contours
- sum - The radar summary
- all - All of the above
- none - No graphics generated
By default, all draw types are turned on. If any of the above are specified, all types are turned off and only those types listed will be turned on. For example, if the data and map are needed but no text labels, specify:
-dr=map,data
Draw types can be added and removed by putting a "+" or "-" in front of the draw type. If this is done, the types are not turned off initially. For example, if only the upper right label and border is to be removed, specify:
-dr=-text_ur,-bord
Window Control
When the window device "-de=w, " is specified, by default, there is no control over the remote wxploop window. To add control over the remote window, there are several window control commands added to WXP. They are specified with the plot_param resource:
- -pp=clear -- Clears the window prior to drawing. By default the original window remains to allow overlays.
- -pp=new -- Creates a new pixmap and makes this the draw window. This forces wxploop to copy the existing pixmap to the newly created one so that the drawing program continues to draw to the same window. The drawing program then draws to the new window in the loop.
- -pp=kill -- Kills the wxploop window at the termination of the graphics program and closes wxploop as well.
Full Plots
In some cases, it is necessary for the plotted data to fill the entire window. By default, WXP allots room above and below the plot for labels to be displayed. To turn this feature off, use the "full" plot parameter.
-pp=full
Changing Plot Labels
The label resource is used to change the text labels that appear above and below the plot. Each label must by preceded with a location specifier:
ul | uc | ur |
PLOT |
||
ll | lc | lr |
followed by a color ":" and the text. The string may have spaces but the string must be quoted. Underscores can be placed in the string to denote spaces if needed. Multiple labels are separated by commas.
Special Characters
There are special characters that can be used to use date information in the label:
- %y -- last two digits of the year
- %m -- the two digit month
- %b -- the three letter month abbreviation
- %d -- the two digit day
- %h -- the two digit hour
- %n -- the two digit minute
- %% -- the percent sign
- _ -- underscore is replaced by a space
Overlay Labels
When more than one plot is overlaid, the labels are lined up top to bottom. The font size is reduced in order to make sure the labels appear on the window. For example:
Surface Temperature (C) 850 mb Wind speed (knt)
In some cases, as defined in the variable files, the labels can be condensed for composite plots where there are more the 3 or 4 overlays. By grouping variables, only one label appears.
Also, there is the ability to use shorten labels by using the label encoding plot parameters:
Value | Description | Syntax | Lines | Example |
labmin | minimal labels | level varabbr | single | 850 temp |
labsimp | simple labels | level varabbr (unit) | single | 850 temp (C) |
labnorm | normal labels | level variable (unit) | multi | 850 mb Temperature (C) |
labcomp | complete labels | level variable (unit)-format | multi | 850 mb Temperature (C) - %.1f |
-pp=labsimp
Will use the simple labels. If there is an overlay, the label will appear concatenated on one line.
Multiprogram Overlay
Within a single program, it knows how many overlay products there are and adjusts the labels accordingly. If more than one program with WXPloop or Postscript is being used, then the overlay line adjustments have to be done manually. This is done with the "over" plot parameter. The syntax is "over:num:max" where max is the total number of overlays (used for text scaling) and num is the number of the current overlay number (0 to max-1).
Changing Time Zones
By default, WXP displays all times in universal time (UTC). The programs use
"Z" for the time zone label for simplicity. To change the
time zone displayed on the plots, use the "tz" plot parameter.
The syntax is tz:label:offset
.
For example:
-pp=tz:EST:-5
would plot the time in Eastern Standard Time. The "EST" is only for the label. The critical part is the time offset "-5" which is the number of hours from UTC. The result would be a string like "835 EST 14 MAR 98"
To get time to display as AM/PM, add a plus "+" to the beginning of the label "+EST". The result would be "4:00 PM EST 23 FEB 98".
Color Bar
A color bar can be displayed on the image if the "bar" plot parameter is set. It appears in the lower left corner of the plot and shows the colors used in the color fill plot labeled with their associated values:
If there are too many labels, appropriate ones will be skipped. If colored plotting is enabled, the color bar can also be used. If multicolored/multistyles contour lines are used, the color bar will draw colored lines rather than filled regions. The lines will also reflect the line style.
In some cases, the color bar is automatically drawn. To disable this, use the "nobar" plot parameter. To set the range of the color bar, specify the max and min values with the "bar:min:max" plot parameter:
-pp=bar:-10:45The labels on the color bar can be changed with the color_fill resource. If values for the color fills are listed, these values will be used for the color bar labels exactly as they are listed. In addition, there is a "la=label" option to the color fill resource for more specific labels.
Output to Image Files
There is a GIF image encoder/decoder built into WXP. This allows graphics to be saved in image format for future use and use with web servers. There are three methods for saving images to file:
- Automatically by adding "gif=filename" to either the out_file or the plot_parameter resource. The filename is either a file name convention tag or an exact filename. There are two wildcards that can be placed in the filename: %p which is the program name/window title and %i which is the index of the image in a loop.
- Automatically through wxploop's interface
program loopset.
loopset save 0 filename
The same %p and %i wildcards can be used in the filename. - Manually by hitting <Meta>g in the window. The output will be a file which is the first 5 characters of the window title plus ".gif". The image_path resource value is prepended to the filename. If the image is part of a loop, the image number in the loop is added to the filename "ttttt-##.gif" where ## is the image number starting at 0.
If the program has created a loop of images and the program is looping the images, the image save will save all the images in the loop. If the loop is stopped, only that image is saved to file.
Interlaced GIF Images
To save GIF images in interlaced format, use the "gifinter" plot parameter.
-pp=gifinter
Inverse Images
By default, WXP uses a black background with data plotted in green and a map in red. For some applications, it is required for WXP to have white backgrounds. This is especially true for GIF images that go on a web server whose purpose is to be printed. When inverted, only a couple of colors change. First, the background color defaults to white. Any piece of information that is plotted in white is now plotted in black. Those plotted in yellow are now plotted in brown. There are two methods for inverting the image:
- Automatically by specifying "inv" for the plot parameter or by setting
the wxpinverse environment variable:
setenv wxpinverse on
By specifying pscolor for printed output, the colors are automatically inverted. - Manually by changing the background and specific colors to achieve the desired results.
Viewport Specification
In some cases, the user may want control over exactly where in the window the plot is
being displayed. This can be done in a number of ways. One way is with WXPloop
and the geometry specification. If you are not using WXPloop, the
geometry relates to the window and not the plot. As a result, the viewport size can
be specified with the "vp_size" plot parameter. The
syntax is: "dxxdy[+x+y]
".
These coordinates represent the fractional panel coordinates. The dx and dy
represent the fraction of the overall window ( 0 < dx < 1)
the panel will use. The x and y are the offsets measured from the lower
left. For example, to produce a 4 panel plot (2x2) and the current plot is the upper left,
the geometry would be:
-pp=vp_size:.5x.5+0+.5
Last updated July 21, 1998