motif(options="", color=T, ignore.sgraphrc=F, ...)
-xrm
(for X Toolkit style resource specifications) and
-display
.
See your X11 documentation,
the examples below, and the chapter Customizing Your S-PLUS Session in the
S-PLUS User's Manual for more information.
use.device.palette(TRUE)
or
use.legacy.graphics(TRUE)
has been called.
S-PLUS uses a global color palette and global image color palette.
If supplied and TRUE, then a color colorscheme is set. If set and FALSE, then a black and white colorscheme is set. If color is not set then the colorscheme set by the X resources is used - this is a color colorscheme by default.
-display
option or the DISPLAY environment variable.
If your resource specifications are incompatible
with the X server (e.g., the server does not have the specified font,
or color, or space for the specified number of halftone patterns),
motif
will report it is "Bailing Out!" and you must try starting
it again with a different set of resources before you can do any
plotting.
Static plots will be automatically rescaled when the size of the graphics
window is changed through the window manager, but it is advised that
the window not be resized while running
brush
or
spin
.
Do not destroy the S-PLUS graphics window through a window manager supplied
menu; if you no longer want the window, use the
dev.off
function.
If you get the error:
X11 Toolkit Error : Can't Open display
while trying to start the
motif
graphics device, there are two likely
causes of the problem: Your DISPLAY environment variable
may be set incorrectly (or not set at all), and/or the machine that you are
running S-PLUS on does not have access to your X11 server.
First, make sure your DISPLAY variable is set correctly.
Exit S-PLUS
(with the
q
function) and type the following (for the UNIX C-Shell):
setenv DISPLAY machinename:displaynumber.screennumber
where machinename is the name of the machine running the X11 server
(the computer you are sitting in front of), and displaynumber and
screennumber designate the display and screen of that machine.
In most cases, both of these numbers will be "0".
For example, if you are sitting in front of a workstation named "fay",
which has one X11 display and one screen, you will want to type:
setenv DISPLAY fay:0.0
(If you do not know the name of the machine that is running the X11 server, and
you are running S-PLUS on the same machine, you may substitute "unix"
for the name of the machine.
Also, note that the display may be specified as an option to
the
motif
function.
The S-PLUS command:
motif("-display fay:0.0")
will attempt to show its graphics window on "fay's" X11 server.)
If you are running S-PLUS and the X11 server on different machines, the steps
above may not be enough to allow you to access your display.
The machine running S-PLUS must have access to the X11 server.
To accomplish this,
type the following at a UNIX shell prompt on
the machine running the X11 server:
xhost + machinename
where machinename is the name of the machine running S-PLUS.
For example, if you are running S-PLUS on a computer named "donna" and
are sitting in front of a computer named "fay", you will want to type
xhost + donna
at a shell prompt on "fay", to which you should get the response:
donna being added to access control list
(Note that the use of xhost supersedes "MIT-MAGIC-COOKIE" security.
If you wish to abide by that system,
consult your X11 documentation,
or your system administrator for information on how to allow remote hosts
access to X11 servers using xauth.)
If, after following the steps above, you are still unable to gain display
access, consult your X11 documentation, or your system administrator.
In the example below, we show how to make a S-PLUS graphics window when
remotely logged in on a machine named "cyclops" from a machine
named "betty" running X11.
There will be two graphics fonts,
cex=1
will give you font0
(10 point helvetica, Roman style).
The last entry ("Font") makes the command buttons and menus use the
font name "fixed".
If the X11 resource database is properly set up, there is seldom a need
to pass options to the
motif
command.
The Customizing Your S-PLUS Session chapter of
The S-PLUS User's Manual
describes how to set up the X11 resource database.
The
motif
graphics window includes dialogs
for editing your color schemes and printing options.
If you save changes in these dialogs, a file named .sgraphrc
is created in the subdirectory MySwork of your home directory.
If you later want to back out your changes, simply delete the
.sgraphrc file, and your defaults will be restored.
NOTE: Color schemes can be edited using the Color Scheme Editor dialog only if
use.device.palette(TRUE)
or
use.legacy.graphics(TRUE)
has been called.
By default, S-PLUS uses a global color palette and global image color palette to map color indices to specific colors. Color arguments can have integer values that map into the color palette, or they can be specified by RGB values or color names. For more information on color specification, see the chapter "Graphics Enhancements" in the Guide to Graphics.
On some versions of Linux the system's Motif libraries will not accept a ":" (colon) at the end of a "FontList" resource. Many X servers on other platforms (e.g, Solaris) put colons on the ends of several FontList resources. Thus if you run motif() on such a Linux machine with the display on a Solaris (or other) machine you may get a series of messages of the form
Warning: Name: FONTLIST_DEFAULT_TAG_STRING Class: XmRendition Conversion failed. Cannot load font.and motif() will not start. To work around this problem you need to remove the colon from the ends of all the FontList resources. You can do this at the unix command prompt with
xrdb -query | grep FontList > FontList.resources ... The file FontList.resources will have entries like ... *XmText*FontList: -dt-interface user-medium-r-normal-s*-*-*-*-*-*-*-*-*: ... Edit the file FontList.resources, removing the trailing colons, ... not the colon between the resource name, "...FontList", and ... the resource value, "-dt-...-*". That line should be ... *XmText*FontList: -dt-interface user-medium-r-normal-s*-*-*-*-*-*-*-*-* xrdb -override FontList.resources
Some verions of Unix/Linux put the X configuration file XKeysymDB in odd places. Splus looks in several common places, but if you see the message "S-PLUS Motif Warning: translation table problems, probably cannot find file XKeysymDB (set XKEYSYMDB?)" you should try setting the environment variable XKEYSYMDB to the full path to the XKeysymDB file. If you see this warning you will not be able to use the Tab and other keys to avoid using the mouse in the motif window's menus and dialog boxes. S-SPLUS includes an old version of XKeysymDB in $SHOME/splus/lib/X11 that may work well enough for you, but one specific to your machine would be best.
OSF/Motif User's Guide. Open Software Foundation.
Quercia, V. and O'Reilly, T. (1988) X Window System User's Guide. O'Reilly & Associates, Inc.
The "Window System Details" and "Customizing Your S-PLUS Session" chapters of The S-PLUS User's Manual.
The S-PLUS Installation and Maintenance Manual, and the chapter "S-PLUS Graphic Device Support" in the Guide to Graphics.
# Run this command on betty, the X server machine in a Unix shell: # xhost + cyclop # Then rlogin to cyclops, start S-PLUS and the issue the commands: X11.betty <- c("-display betty:0.0", "-xrm 'sgraphMotif*defaultFont:0'", "-xrm 'sgraphMotif*fonts:*helvetica-medium-r-*-10-* \\ *helvetica-medium-r-*-12-* \\ *helvetica-medium-r-*-14-* \\ *helvetica-medium-r-*-18-* \\ *helvetica-medium-r-*-24-*'") motif(X11.betty) # Another call to motif; this one puts the graphics window # in the upper-left corner: motif(c("-d betty:0", "-geometry +0+0"))