ScilabGraphic0
window .
The different drivers are:
X11
: graphics driver for the X11 window system
Rec
: an X Window driver (X11) which also
records all the graphic commands. This is the default
(required for the zoom and rotate).
Wdp
: an X11 driver without recorded
graphics; the graphics are done on a pixmap and are send to
the graphic window with the command xset("wshow"). The
pixmap is cleared with the command xset("wwpc") or with the
usual command xbasc()
Pos
: graphics driver for Postscript printers
Fig
: graphics driver for the Xfig system
In the 3 first cases the 'implicit' device is a graphics window (existing or created by the plot). For the 2 last cases we will see later how to affect a specific device to the plot : a file where the plot will be recorded in the Postscript or Xfig format.
The basic Scilab graphics commands are :
driver
: selects a graphic driver
The next 3 commands are specific of the X-drivers :
xclear
: clears one or more graphic windows; does
not affect the graphics context of these windows.
xbasc
: clears a graphic window and erase the
recorded graphics; does not affect the graphics context of
the window.
xpause
: a pause in milliseconds
xselect
: raises the current graphic window
(for X-drivers)
xclick
: waits for a mouse click
xbasr
: redraws the plot of a graphic window
xdel
: deletes a graphic window (equivalent to the
Close button
The following commands are specific of the Postscript and Xfig drivers :
xinit
: initializes a graphic device
simply opens a graphics window for the X-drivers this command
is necessary for Postscript and Xfig drivers.
xend
: closes a graphic session (and the
associated device).
In fact, the regular driver for a common use is Rec and there
are special commands in order to avoid a change of driver; in many
cases, one can ignore the existence of drivers and use the
functions xbasimp
, xs2fig
in order to send a graphic
to a printer or in a file for the Xfig
system. For example with
:
-->driver('Pos') -->xinit('foo.ps') -->plot(1:10) -->xend() -->driver('Rec') -->plot(1:10) -->xbasimp(0,'foo1.ps')
we get two identical Postscript files : 'foo.ps' and 'foo1.ps.0' (the appending 0 is the number of the active window where the plot has been done).
The default for plotting is the superposition; this means that between
2 different plots one of the 2 following command is needed :
xbasc(window-number) which clears the window and erase the
recorded Scilab graphics command associated with the window
window-number
or xclear) which simply clears the window.
If you enlarge a graphic window, the command xbasr(window-number)
is executed by Scilab. This command clears the graphic window
window-number
and replays the graphic commands associated with it. One
can call this function manually, in order to verify the associated
recorded graphics commands.
Any number of graphics windows can be created with buttons
or with the commands xset
or xselect
. The environment
variable DISPLAY can be used to specify an X11 Display or one can use
the xinit
function in order to open a graphic window on a
specific display.