Skip to content

Is it possible to modify the position of the graphic window ?

12 messages · 8rino-Luca Pantani, Henrique Dallazuanna, Brian Ripley +3 more

#
Dear R users,
is there a way to tell R where to draw the windows where the plots are 
drawn ?

I always get that window on the right of my screen, where it interferes 
with my Xemacs + ESS window where I'm writing lines.

Of course I can move it manually, but I would like to have it 
permanently on the right, rather than on the left.

Thanks for any advice

Ottorino


Ubuntu 7.10
Xemacs 21.4 patch 20
ESS version 5.3.4
R version 2.5.1 (2007-06-27)
#
There's a Renviron file under /etc/R, but there are no lines with 
"position (x, y)".

Henrique Dallazuanna ha scritto:
#
On Linux the default graphics device is X11(), and not so on Windows.

?X11 tells you no less than *two* ways to do this: I do wonder why you 
don't just read the help file?

?options (see 'device') tells you how to set up a default device which you 
could use to change default arguments, but using the X11 geometry 
resources is the canonical way to do this.
On Tue, 6 Nov 2007, 8rino-Luca Pantani wrote:

            

  
    
#
I see.
Thanks for your highly appreciated help, Prof. Ripley.


I've been reading the x11 help file, only after people from this list 
told me that it is the default in Linux

Please consider that I recently (and definitely) moved to linux from 
Windows, and I still need to re-learn a lot of things.

I did'nt know that with "options" was possible to change the x11 windows.
I typed the following, and it worked
options(device= x11(xpos =500))
moving the window on the left
Now, if I'm allowed to push your patience a little further, how can I 
make this change permanent ?

Thanks again
Ottorino Pantani

Prof Brian Ripley ha scritto:

  
    
#
On Tue, 6 Nov 2007, 8rino-Luca Pantani wrote:

            
Better to use resources.  But you can use (in .Rprofile)

options(device=function() x11(xpos=-1))

The resources version would be to put in ~/.Xresources something like

R_x11*geometry: 700x700-0+0

  
    
#
8rino-Luca Pantani wrote:
Umm, I think that one only seemingly "works". It does the same as plain 
x11(xpos=500) followed by options(device=NULL) (try removing the window 
and then plot(0)).

More likely, you want
  options(device = function() x11(xpos=500) )
which you can handle using the techniques described under ?Startup (i.e. 
stick it in a .Rprofile file, for instance).

(xpos=-1 might be better if you switch between different-sized screens, 
though)

  
    
#
On 7/11/2007, at 6:39 AM, Prof Brian Ripley wrote:

            
Neither of these options appears to have any effect under Mac OSX.
	I run R from the command line from a terminal window (not from the GUI)
	and I have X11 installed so that in R

		> x11()

	does indeed put up a graphics window.  But it always puts it (the  
initial
	window) in exactly the same place, irrespective of my having put the
	specified line in ~/.Xresources before starting R, or having issued the
	specified options() command immediately after having started R (before
	issuing the x11() command).

	It's no big deal --- I'm reasonably happy with the default position  
of the
	window.  I just hate it when a computer refuses to follow  
instructions, with
	no explanation. :-(

			cheers,

				Rolf Turner

P. S.:

 > sessionInfo()
R version 2.6.0 (2007-10-03)
i386-apple-darwin8.10.1

locale:
C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] misc_0.0-2

loaded via a namespace (and not attached):
[1] rcompgen_0.1-15


######################################################################
Attention:\ This e-mail message is privileged and confid...{{dropped:9}}
#
1) Did you merge the resources or restart X?  You need to in order to get 
new resources to be recognized.

xrdb -merge ~/.Xresources would be needed to merge resources into the 
current X session.

I don't know if MacOS X11 is standard enough to support this, but it is a 
very long-standing basic part of X11.

2)
options(device=function() x11(xpos=-1))
plot(1:10)

should work (does for me): it does not affect x11() in any way, just the 
auto-start graphics device.
On Wed, 7 Nov 2007, Rolf Turner wrote:

            

  
    
#
On 7/11/2007, at 9:12 AM, Prof Brian Ripley wrote:

            
No I didn't.  Didn't know or didn't remember about the merge  
business.  Dang!
	That works.  But only for the auto-start device, not for x11().
Right.  That works too.  Missed the distinction between x11() and  
the auto-start device.

	Thanks very much.

		cheers,

			Rolf

######################################################################
Attention:\ This e-mail message is privileged and confid...{{dropped:9}}
#

        
RT> On 7/11/2007, at 9:12 AM, Prof Brian Ripley wrote:
>> 1) Did you merge the resources or restart X?  You need to
    >> in order to get new resources to be recognized.
    >> 
    >> xrdb -merge ~/.Xresources would be needed to merge
    >> resources into the current X session.

    RT> 	No I didn't.  Didn't know or didn't remember
    RT> about the merge business.  Dang!  That works.  But only
    RT> for the auto-start device, not for x11().

Really?  It should influence all instances of x11(), not only
the "auto-start device" --- which, BTW, is identical to
getOption("device") as has been mentioned here ---
and it does so for me {on Linux}.

BTW: For testing,  you can use xrdb directly, i.e., in a shell:

   echo 'R_x11*geometry: 500x700-0-0' | xrdb -merge

The above option looking useful for my typical use with ESS.
Martin

    >> I don't know if MacOS X11 is standard enough to support
    >> this, but it is a very long-standing basic part of X11.
    >> 
    >> 2)
    >> options(device=function() x11(xpos=-1)) plot(1:10)
    >> 
    >> should work (does for me): it does not affect x11() in
    >> any way, just the auto-start graphics device.

    RT> 	Right.  That works too.  Missed the distinction
    RT> between x11() and the auto-start device.

    RT> 	Thanks very much.

    RT> 		cheers,

    RT> 			Rolf

    RT> ######################################################################
    RT> Attention:\ This e-mail message is privileged and
    RT> confid...{{dropped:9}}

    RT> ______________________________________________
    RT> R-help at r-project.org mailing list
    RT> https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do
    RT> read the posting guide
    RT> http://www.R-project.org/posting-guide.html and provide
    RT> commented, minimal, self-contained, reproducible code.