Tips for Using xmgr

xmgr is a menu-driven program for 2D plotting that produces publication quality output. It also has a command language for designing templates for complex figures. In addition to plotting, xmgr can do some data analysis, such as regressions, splines, fft's, and applying functions to data.

It is invoked by typing "xmgr" on any of our workstations (RS/6000, SGI, Linux). It is recommended that the following line be included in your .Xdefaults file:
XMgr*fontList: -adobe-helvetica-bold-r-normal--14-*-*-*-*-*-iso8859-1
Otherwise, the menus will appear in a small, indistinct font.

Some Simple Examples to Get Started:

You can have up to 10 graphs, each of which can have up to 30 data sets contained in one file divided up arbitrarily among several files, provided the right flags are given. The total number of points plotted can be in the hundreds of thousands. (The limits 10 and 30 can be increased with the maxsets, maxgraph, and graphsets options described below.)

Additional Sources of Information

There is an 80 page manual in the computer room which has a brief tutorial on pp. 12-20. There is a brief man entry that can be accessed by typing man xmgr, provided MANPATH is set to "/usr/local/man:/usr/man". There is a detailed Web-based manual at: http://mrb.niddk.nih.gov/xmgr/index.html. The Web manual is also accessible from within xmgr if you do
"setenv GR_HOME /software/xmgr".
(xmgr will now try to open a new Netscape session when you click on Help or press F1. If you are already running Netscape, just go to the URL above. Nonetheless, defining GR_HOME will suppress an annoying error message.)

If you prefer to learn by example, there are numerous examples in /software/xmgr/examples, and a script called "dotest" which will give a demonstration of xmgr's features by applying xmgr to the data and parameter sets in that directory. Type "dotest" in that directory; use F3 to kill the current graph and go on to the next one.

Finally, there is a world-wide listserv where you can post sticky questions. To subscribe send email to:
Majordomo@admin.ogi.edu
with the following command in the body of your email message:
subscribe acegr Firstname Lastname email-address
To get off the list send:
unsubscribe acegr email-address

More Tricks

  1. To pipe data from a program:
    prog | xmgr -source stdin
  2. To use a template (parameter file):
    xmgr -param file.par file.dat
  3. To print in batch mode:
    grbatch file
    (setenv GR_HDEV 2 for postscript portrait; default is 1 = landscape)
  4. With NCD terminals, use -GXinvert to see rubber bands and focus markers
  5. With RS/6K can use -bs to fake backing store instead of redrawing on expose events.
  6. How to digitize images:

Command Line Arguments:

(output of "xmgr -usage")

XMgr v3.01pl7
(C) Copyright 1991-1995 Paul J Turner
All Rights Reserved
Usage of xmgr command line arguments:
-maxsets [number_of_sets] Set the number of data sets per graph (minimum is 30)
-maxgraph [number_of_graphs] Set the number of graphs for this session (minimum is 10)
-autoscale [x|y|xy] Override any parameter file settings
-noauto [x|y|xy] Supress autoscaling for the specified axis
-arrange [rows] [cols] Arrange the graphs in a grid rows by cols
-cols [cols]
-rows [rows]
-batch [batch_file] Execute batch_file on start up
-noask Assume the answer is yes to all requests - if the operation would overwrite a file, ACE/gr will do with out prompting
-pipe Read data from stdin on startup
-logwindow Open the log window
-nologwindow No log window, overrides resource setting
-device [hardcopy device number]
-hardcopy No interactive session, just print and quit
-eps Set the PostScript driver to write EPS
-log [x|y|xy] Set the graph type to logarithmic
-legend [load] Turn the graph legend on
-printfile [file for hardcopy output]
-graph [graph number] Set the current graph number
-graphsets [number_of_sets] Set the number of data sets for the current graph
-graphtype [xy|bar|stackedbar|hbar|stackedhbar] Set the type of the current graph
-world [xmin ymin xmax ymax] Set the user coordinate system for the current graph
-view [xmin ymin xmax ymax] Set the viewport for the current graph
-results [results_file] write the results from regression to results_file
-source [disk|pipe|stdin] Source of next data file
-param [parameter_file] Load parameters from parameter_file to the current graph
-pexec [parameter_string] Interpret string as a parameter setting
-type [xy|xydx|xydy|xydxdx|xydydy|hilo] Set the type of the next data file
-ihl [ihl_file] Assume data file is in IHL format (local)
-xy [xy_file] Assume data file is in X Y format - sets are separated by lines containing non-numeric data
-nxy [nxy_file] Assume data file is in X Y1 Y2 Y3 ... format
-xydx [xydx_file] Assume data file is in X Y DX format
-xydy [xydy_file] Assume data file is in X Y DY format
-xydxdx [xydxdx_file] Assume data file is in X Y DX1 DX2 format
-xydydy [xydydy_file] Assume data file is in X Y DY1 DY2 format
-xydxdy [xydxdy_file] Assume data file is in X Y DX DY format
-xyz [xyz_file] Assume data file is in X Y Z format
-xyd [xyd_file] Assume data file is in X Y density format
-xyr [xyr_file] Assume data file is in X Y RADIUS format
-rawspice [rawspice_file] Assume data is in rawspice format
-block [block_data] Assume data file is block data
-bxy [x:y:etc.] Form a set from the current block data set using the current set type from columns given in the argument
-hilo [hilo_file] Assume data is in X HI LO OPEN CLOSE format
-boxplot [boxplot_file] Assume data is in X MEDIAN Y1 Y2 Y3 Y4 format
-netcdf [netcdf file] Assume data file is bnetCDF format
-netcdfxy [X var name] [Y var name] If -netcdf was used previously, read from the netCDF file, 'X var name' and 'Y var name' and create a set. If 'X var name' equals "null" then load the index of Y to X
-rvideo Exchange the color indices for black and white
-mono Run xmgr in monochrome mode (affects the display only)
-seed [seed_value] Integer seed for random number generator
-GXxor Use xor to draw rubberband lines and graph focus markers
-GXinvert Use invert to draw rubberband lines and graph focus markers
-bs Do backing store
-nobs Suppress backing store
-dc Allow double click operations on the canvas
-nodc Disallow double click operations on the canvas
-maxcolors [max_colors] Set the number of colors to allocate (minimum is 17)
-redraw Do a redraw for refreshing the canvas when the server doesn't do backing store
-noredraw Don't do a redraw for refreshing the canvas when the server doesn't do backing store
-debug [debug_level] Set debugging options
-image [image_file] Argument is the name of an X Window dump (.xwd format)
-imagexy [X] [Y] Arguments are the position of the image in pixels, where (0,0) is the upper left corner of the display and y increases down the screen
-noprint In batch mode, do not print
-usage This message