Contents Previous Next Subchapters

Using Identifier To Switch Between Graphic Viewports
Syntax gview
gview(
identifier)
See Also gaddview glistview gwin , and gview(right, up)
Menu Command Graphics | Viewport | Select/Clear/Delete . . . | (Select)

Description
If identifier is not present, returns the integer scalar identifier for the current viewport. If identifier is present, sets the current viewport to the one specified by identifier, where identifier is an integer scalar. In this case, the function returns the right, up, width, and height, which were used to create the viewport as a four-column real row vector.

Example
If you enter
     ginit
     lower = gaddview(0., 0., 1., .5)
     print "lower =", lower
O-Matrix will respond
     lower = 1
in the Command window because this is the identifier for the new viewport. If you then enter
     gview
O-Matrix will respond
     1
because the new viewport is the current viewport. If you then enter
     upper = gaddview(0., .5, 1., .5)
     gplot(seq(5))
O-Matrix will draw a plot in the upper half of the Graphic 0 window. If you then enter
     gview(lower)
O-Matrix will respond
     [ 0 , 0 , 1., 0.5 ]
because these are the right, up, width, and height, which were used to create the lower viewport. If you then enter
     gplot(seq(3))
O-Matrix will generate a plot in the lower viewport (because the last call to the gview function made it the current viewport).