$Id: xmgr.faq,v 1.1 1995/05/27 02:35:00 pturner Exp pturner $

Archive-name: xmgr-faq
Last-modified: APR 18, 1995
Posting-Frequency: whenever
Version: 0.0

xmgr FAQ

[Last changed: 18 APR 95]

This article contains the answers to some Frequently Asked Questions (FAQ) 
often seen on the xmgr mailing list. It is posted to help reduce volume in 
this mail list and to provide hard-to-find information of general interest.

   This article is located at:

	ftp://ftp.teleport.com/pub/users/pturner/xmgr/xmgr.faq
	http://www.teleport.com/~pturner/xmgr/xmgr.faq

This FAQ is maintained by Paul J Turner (pturner@teleport.com).

Send updates and corrections to me at that email address.  It would help if
the subject line contained the phrase "For xmgr FAQ". I will be making a
HTML version available sometime in the future.

Thanks to all who have contributed to this FAQ.

================================

This article includes answers to the questions listed below. Key:

                + questions NEW to this issue;
                * CHANGES since last issue.

-1)+ Administrivia - How do I get off this *%!$&*#@ mailing list?
 0)+ What is the most recent version of xmgr and where do I get it?
 1)+ I've found a bug in xmgr, how do I report it?
 2)+ While compiling xmgr on [Suns or Linux] I get error 
     messages about missing include files?
 3)+ How are math operations done between sets?
 4)+ How do I set the background color of a plot, outside of the graph frame?
 5)+ I run xmgr and get the following error messages:
Warning: translation table syntax error: Unknown keysym name: osfPageLeft
Warning: ... found while parsing '<Key>osfPageLeft:SWLeftPage()'
[...]
 6a)+ What happened to the Alternate axis?
 6b)+ I'd like plot data against an axis on the right (top) and another
      data set against an axis on the left (bottom)?
  7)+ Can I use different fonts, symbols, font size, or sub/superscript in Xmgr?
  8)+ How is hh:mm:ss data input? I have logfiles with time in this format 
      but seem unable to persuade xmgr to read it.
  9)+ How do I get the Angstrom symbol to show up in labels, titles, text?
 10)+ Will xmgr do 3d plots, animation and/or contouring?
 11)+ How do I build xmgr under Solaris 2.4?
 12)+ Where is the non-linear curve fitting module in 3.0x?
 13)+ Where is grbatch? How does batch printing work?
 14)+ Why aren't fills using patterns printed using the PostScript
      driver?

------------------------------------------------------------------

-1) How do I get off this *%!$&*#@ list?

Please, do not send requests to unsubscribe to the mailing list, 
there are over 250 people on the list and everyone of them will
need to process your message, if you are having problems with your 
subscription, send mail to me directly.

To subscribe or unsubscribe send mail to:

        majordomo@admin.ogi.edu

with a body of (not in the "Subject:" line):

        subscribe xmgr

to subscribe to the list. To unsubscribe from the list:

        unsubscribe xmgr

You'll need to make sure that when unsubscribing, you use
the same E-mail address you used to subscribe. If it is not
possible to use that address, then use

        unsubscribe xmgr jdoe@host.inst.domain

Where jdoe@host.inst.domain is the original address. If you aren't
sure what the address you used is, check the header on any mail 
message you've received from the list.

For information about majordomo at our site, sent mail to 
majordomo@admin.ogi.edu with a body of

        help

Use the address xmgr@admin.ogi.edu to send mail to the list.

The xmgr mailing list is unmoderated, meaning that mail sent
to the list is automatically forwarded to all subscribers.

------------------------------------------------------------------

 0) What is the most recent version of xmgr and where do I get it?

     The most recent version of xmgr is 3.01 patchlevel 4 and is
     located at the URL:

        ftp://ftp.teleport.com//pub/users/pturner/xmgr-3.01pl4.tar.Z
        ftp://ftp.ccalmr.ogi.edu//pub/xmgr/xmgr-3.01pl4.tar.Z

     The previous version 3.01 patchlevel 3 is at:

        ftp://ftp.ccalmr.ogi.edu//pub/xmgr/xmgr-3.01pl3.tar.Z

------------------------------------------------------------------

 1) I've found a bug in xmgr, how do I report it?

     You can send mail to the mailing list (xmgr@admin.ogi.edu) or
     to pturner@teleport.com. Included in your report should be
     the version of xmgr and the patchlevel. Also, include the 
     machine type, operating system name + version number, and
     any other information that might be useful.

------------------------------------------------------------------

 2) While compiling xmgr on [Suns or Linux] I get error 
     messages about missing include files?

     Depending on the vendor the answer to this question varies:

     a. The include files are there but in a non-standard place.
        Check with your local sys admin.
     b. The system is a SUN. Prior to Solaris 2.4 (this may be
        incorrect), Motif was something that needed to be purchased.
     c. The system is running Linux, again, Motif is commercially 
        available.
     d. The system uses the Motif window manager but may require
        a 'development' license to get the libraries and include files
        needed to build xmgr. Seems that most vendors do this.

------------------------------------------------------------------

 3) How are math operations done between sets?

When using Edit/Transformations/Evaluate expression, it is important to 
keep in mind that x and y refer to the set selected in the choice item of 
this popup. If you set a=y and don't change the set number, then b=y will 
load to a and b the same y (in this case, y from set 0). Computing y=a-b 
will get you a vector of zeros. The proper sequence of events is:

1. Copy s0 to s2 using Edit/Set ops/Copy set.
2. Using Edit/Transformations/Evaluate expression with the set 0 
   selected, perform a=y.
3. Select set 1.
4. Perform b=y.
5. Select set 2.
6. Perform y=b-a.
7. Done.

This popup is a holdover from a long time ago (with 3.02 given the new 
way of selecting sets, it will become more useful). I'd use the 
File/Commands popup and explicitly give the set number as follows:

copy s0 to s2
s2.y = s1.y - s0.y

Now, s2 will have the difference. It is important to note that the 
lengths of s0 and s1 must be the same.

Another example follows, save to a file and use File/Commands/Read:

# Demo of operations between sets
#
# Open File/Commands and Read this file, then
# click on Replay.
#
# activate s0, s1 and set their lengths
#
activate s0 1024
activate s1 1024
#
# load the index (1, 2, ..., 1024) of each point to x
#
s0.x = index
s1.x = index
#
# Stuff something into y of both sets
#
s0.y = 2*cos(2*pi*x/100) + 5 * sin(2*pi*x/35)
s1.y = 3*cos(2*pi*x/100) + 7 * sin(2*pi*x/35)
#
# Let's save s0 to s2
#
copy s0 to s2
#
# Compute the difference
#
s0.y = s0.y - s1.y
#
# Autoscale on the difference
#
autoscale s0
#
# pause a bit
#
sleep 5
#
# let's look at all of the active sets
#
autoscale

------------------------------------------------------------------

  4)  How do I set the background color of a plot, outside of the graph frame?

  Use graph 0 as the background:
    1.  set the viewport for graph 0 such that 0<x<1 and 0<y<1
    2.  fill the frame of graph 0 with whatever color you want
    3.  graphs 1 and up will plot in front of graph 0, so the desired
         effect is achieved.

"Stewart A. Rounds, Hydrologist, Portland, OR " <sarounds@wrdmail.er.usgs.gov>

------------------------------------------------------------------

   5) I run xmgr and get the following error messages:

xmgr (xmgr) v3.01pl3
(C) Copyright 1991-1994 Paul J Turner
All Rights Reserved
Warning: translation table syntax error: Unknown keysym name: osfPageLeft
Warning: ... found while parsing '<Key>osfPageLeft:SWLeftPage()'
Warning: translation table syntax error: Unknown keysym name: osfPageRight
Warning: ... found while parsing '<Key>osfPageRight:SWRightPage()'
Warning: translation table syntax error: Unknown keysym name: osfPageLeft
Warning: ... found while parsing '<Key>osfPageLeft:PageUpOrLeft(1)'
Warning: translation table syntax error: Unknown keysym name: osfPageRight
Warning: ... found while parsing '<Key>osfPageRight:PageDownOrRight(1)'
Warning: translation table syntax error: Unknown keysym name: osfPageLeft
Warning: ... found while parsing '<Key>osfPageLeft:SWLeftPageGrab()'
Warning: translation table syntax error: Unknown keysym name: osfPageRight
Warning: ... found while parsing '<Key>osfPageRight:SWRightPageGrab()'
[...]

Get the XKeySymDB file from the X11R6 distribution.  Put it somewhere
where you can get at it and 

  setenv XKEYSYMDB /place/where/you/put/XKeysymDB
  
This will satisfy xmgr.  It seems that a lot of the motif KeySym names
are missing from the XKeySymDB that comes with SunOS
(/usr/openwin/lib/XKeySymDB).  The X11R6 one lives in
lib/X11/XKeySymDB.

and...

The file XKeySymDB, which is found in /usr/openwin/lib on Sun
Workstations and possibly in /usr/X11/lib on others does not have all
the Motif XKeySyms defined.  Get the XKeySymDB file from the X11R5 or
X11R6 distribution, put it somewhere convenient and "setenv XKEYSYMDB
/path/where/you/put/XKeySymDB".  (Perhaps this file could be distributed 
with future versions of xmgr?)

["M. Scott Wills" <mwills@zephyr.ess.harris.com>]

------------------------------------------------------------------

 6a)+ What happened to the Alternate axis, it was in 2.10,  but missing
      in 3.0x?
 6b)+ I'd like plot data against an axis on the right (top) and another
      data set in a different scale against an axis on the left (bottom)?

The alternate axis made for complications in the axis drawing routines
that made that section of code too difficult to maintain - I dropped it
in favor of overlaying graphs. With this you can achieve the same effect,
but you'll need to pay close attention to which graph is the 'current'
graph. There is a selection in the Graph ops toolbox that should make it
easier to set up the 2 graphs. This is also how to plot data sets 
in different scales against an axis on the right an an axis on the left.

------------------------------------------------------------------

  7) Can I use different fonts, symbols, font size, or sub/superscript in Xmgr?

   Yes, Xmgr has all these features. Wherever you can type a text in xmgr, 
   e.g. Axis labels, graph title, text from Strings&Things, etc., you can use 
   all those features within the same text.  
   Here is how, the following is quoted from the online help provided with 
   Xmgr v3.0 and higher.

Changing fonts within a string 

   To change fonts within a string precede the font number listed below by a
   backslash. To turn subscripting or superscripting on or off use \s for
   subscripts and \S for superscripting. Font selection is current for the
   remainder of the string or until the next font change. Subscripts and
   superscripts remain for the remainder of the string or until \N is seen. To
   print a backslash use \\. To backspace use \b. To begin underlining
   use \u, to stop underlining use \U. \+ increases the size of the
   characters and \- decreases the size of the characters.

   xmgr uses the Hershey fonts to draw text on the screen, but PostScript 
   fonts for hardcopy. There are discrepancies between the two sets of fonts 
   and of this writing, there are problems with the mapping of Greek and 
   special characters.

   Font # Font 
      0 .... Complex Roman on screen, maps to Times-Roman. 
      1 .... Triplex Roman on screen, maps to Times-Bold. 
      2 .... Complex Italic on screen, maps to Times-Italic. 
      3 .... Triplex Italic on screen, maps to Times-BoldItalic. 
      4 .... Simplex on screen, maps to Helvetica. 
      5 .... Duplex on screen, maps to Helvetica-Bold 
      6 .... Complex Italic on screen, maps to Helvetica-Oblique. 
      7 .... Triplex Italic on screen, maps to Helvetica-BoldOblique. 
      8 .... Simplex Greek on screen, maps to the lower 128 characters of the
      Symbol font. 
      9 .... Symbols on screen, maps to the upper 128 characters of the
      Symbol font. 
      x .... Special symbols 

   Summary of other special commands 
      + .... increase size 
      - .... decrease size 
      b .... backspace length of previous character 
      s .... begin subscripting 
      S .... begin superscripting 
      u .... begin underline 
      U .... stop underline 
      N .... return to normal 

Example2: 

 1- Using font 0 and e prints as epsilon from the Simplex Greek font, i.e
   the expression

          \0F\sX\N(\8e\0) = sin(\8e\0)*e\S(-X)\N*cos(\8e\0) 

   prints roughly (in TeX/LaTeX language )
         
           F_X(\epsilon) = \sin(\epsilon)*e^{(-X)}*\cos(\epsilon) 


 2- To increase (decrease) the font size use use \+ ( \- ) special commands.
    The expression
	
	\8p\0\S\+-\N

    prints (in TeX language) 

	\pi^{-}
    with increasing the size of the minus sign.


NOTE: Special characters are mapped to the keyboard, the present mapping is
      not very well organized and may change. 

"Mostafa G.H. Mostafa" <mostafa@gad.phy.ornl.gov>

------------------------------------------------------------------

 8) How is hh:mm:ss data input? I have logfiles with time in this format 
   but seem unable to persuade xmgr to read it.

All the date formats require that the input data be in julian days,
i.e. number of days since some the start of some "epoch".

There are a couple of programs in the contrib directory that comes with
xmgr to help you manipulate dates, but if you output your data in
(floating point) "days" and graph the result, you'll get the idea.

As I recall, the default "autoscale" (heckbert?) mode was very
confusing when used with the date formats.  It is either broken w.r.t.
dates or it simply chose poor values for the data I was giving it (i.e.
tick labels were all 12:00, or some such).  If this happens to you,
switch the autoscale mode to "fixed" instead of "heckbert".

BTW: the "Julian" day apparently begins at noon, so you may need to add
an offset of 0.5 (days) to your data.

["M. Scott Wills" <mwills@zephyr.ess.harris.com>]

------------------------------------------------------------------

  9)+ How do I get the Angstrom symbol to show up in labels, titles, text?

  ISO Latin encodings were added to the PostScript driver by Przemek 
  Klosowski (przemek@rrdbartok.nist.gov). You can now print the Angstrom 
  symbol. There is no onscreen display of the extended characters (something 
  will show, but it won't be right). 3.02 will use the xvertext routines 
  so that it will be a bit more WYSIWYG.  Use \c to go into the upper 
  128 characters and \C to return to normal. \cE\C is the Angstrom symbol.

------------------------------------------------------------------

 10)+ Will xmgr do 3d plots, animation and/or contouring?

  Not any time soon - conflicts with work the author does for pay.

------------------------------------------------------------------

 11)+ How do I build xmgr under Solaris 2.4?

 Here are the lines that make xmgr under solaris 2.4,
 which I suggest be added to the FAQ or into the Makefile
 itself.  Several folks have submitted these suggestions,
 and we are grateful for their help.

 The pointers -L and -R tell xmgr where to look for its
 libraries (the environment variable LD_LIBRARY_PATH should
 work but often doesn't, so it's easier to do this here).
 The conditional compilation flag -DSOLARIS is pretty crucial
 but isn't mentioned anywhere that we could find it.

 ### Sun - Solaris 2.4 - Motif 1.2.2/X11R5
 LIBS = -L/usr/openwin/lib -L/usr/dt/lib -lXm -lXt -lX11 -lm \
 -R/usr/openwin/lib  -R/usr/dt/lib
 INCLUDES = -I/usr/openwin/include -I/usr/dt/include
 CC = gcc -g -O -DSOLARIS
 ### End Sun Solaris

 This is for xmgr-3.01pl3, I should add.

 Dean Urban
 Duke School of the Environment

 ------------------------------------------------------------------

 12)+ Where is the non-linear curve fitting module in 3.0x?

 The non-linear curve fitting routines are still in 3.0x but not
 immediately visible. You can get them by executing

 xmgr -nonl

 The reason for this is that these routines are not supported and
 were in earlier versions for testing purposes only. Be very, very
 careful about the results.

 ------------------------------------------------------------------

 13)+ Where is grbatch? How does batch printing work?
  
 Grbatch is simply a copy of xmgr named grbatch or a symbolic link from 
 xmgr (xvgr) to grbatch. In the case of the symbolic link:

 ln -s xmgr grbatch

 done wherever the xmgr binary is located will do the trick (rehash
 or logout and login to make sure that grbatch shows up in your path).
 Executing grbatch with no command line parameters or data files will produce 
 a hardcopy on the default printer.

 ------------------------------------------------------------------

 14)+ Why aren't fills using patterns printed using the PostScript
      driver?

 The fills and patterns drawn on the screen and the .mif output are
 not matched in the PostScript output, grayscale is the best that
 can be done. I know how to do it, but I haven't found the time.

 ------------------------------------------------------------------
