Graphics Device for the X11 Window System

DESCRIPTION:
Creates a graphics window that conforms to the OPEN LOOK graphical user interface on an X11 or X11/NeWS server. This function is deprecated; use motif instead.

USAGE:
openlook(options="", ...)


OPTIONAL ARGUMENTS:
options:
vector of character strings specifying X11 command line options, such as -xrm (for X Toolkit style resource specifications) and -display. See your OpenWindows or X11 documentation, the examples below, and the chapter Customizing Your S-PLUS Session in the S-PLUS User's Manual for more information.
...:
other options are passed through to the printer drivers used by printgraph. Refer to ps.options for the list of valid commands for the PostScript driver. Each PostScript option should be prefixed with ps. in order to be passed through and recognized as a PostScript driver option. Note that the LaserJet driver has not yet been updated to use this scheme.

SIDE EFFECTS:
a graphics window is created on the screen specified by the -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), openlook 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.

DETAILS:
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 openlook 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 openlook function. The S-PLUS command:

openlook("-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 supercedes "MIT-MAGIC-COOKIE" security. If you wish to abide by that system, consult your OpenWindows or 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 OpenWindows or X11 documentation, or your system administrator.

In the example below, we show how to make an 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 openlook command. The Customizing Your S-PLUS Session chapter of The S-PLUS User's Manual describes how to set up the X11 resource database.


REFERENCES:
OpenWindows Version 2 User's Guide and X11/NeWS Version 2 Server Guide. Sun Microsystems.

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.


SEE ALSO:
motif , X11 , X11SETUP , printgraph , dev.cur , Device.Default , Devices , brush , spin .

EXAMPLES:
{betty}% xhost + cyclops        # Run this command on betty, the X server machine.
{betty}% rlogin cyclops
{cyclops}% Splus
> X11.betty <- c("-display betty:0.0",
                 "-xrm 'sgraphOpenLook*defaultFont:0'",
                 "-xrm 'sgraphOpenLook*fonts:*helvetica-*-R-*-10-*
                                             *helvetica-*-R-*-14-*'")
> openlook(X11.betty)

# another call to openlook; puts the graphics window in the upper-left corner > openlook(c("-d betty:0", "-geometry +0+0))