[R] How to set the size of a rgl window, par3d() ?

Duncan Murdoch murdoch at stats.uwo.ca
Tue Jan 3 17:13:17 CET 2006

On 1/3/2006 10:30 AM, begert wrote:
> Dear R- Users,
>    is there a way to determine the size of
>    an rgl window (rgl.open()) either in advance or
>    afterwards, (without using the mouse, of course) ?
>    Intuitively, one would assume to set the size by:
>    library("rgl");
>    par3d(viewport=c(0,0,500,500));
>    #rgl.open();
>    for example. As the parameter 'viewport' is 'readonly'
>    this results in an error message:
>    Error in par3d(viewport = c(0, 0, 500, 500)) :
>    invalid value specified for rgl parameter "viewport"
>    In addition: Warning message:
>    parameter "viewport" cannot be set.
>    Any possible workarounds ?

Not that I know of.  This is handled by OpenGL and the windowing system; 
rgl just queries OpenGL to give the par3d("viewport") response.

It would take a bit of time to add this, because it would need to be 
added for all 3 output devices (Windows, X11, OSX).

Duncan Murdoch

More information about the R-help mailing list