Skip to content

Location of plot() window

4 messages · Dennis Fisher, Ralph O'Brien, Simon Urbanek

#
R 3.5.0
OS X

Colleagues

When I open a plot() window on-screen, it appears in the lower left corner of the screen.  
Is it possible to control the location?  If so, what commands?  
And, if so, can I locate it to a display other than the primary display?

Dennis



Dennis Fisher MD
P < (The "P Less Than" Company)
Phone / Fax: 1-866-PLessThan (1-866-753-7784)
www.PLessThan.com <http://www.plessthan.com/>
#
PlotDirector() instructs R to

 <> display the next plot in a separate graphics window appropriate for the
operating system being used (Windows, Mac, or Linux),
or
 <> build a graphics file in PDF, JPG, PNG, or SVG format.

Visit http://rfuncs.weebly.com/plotdirector.html for full description and
to download the code.

I welcome all feedback.


Ralph O'Brien, PhD
Retired Professor of Biostatistics
(but still keenly professionally active:
http://rfuncs.weebly.com/about-ralph-obrien.html)
Dept. of Population and Quantitative Health Sciences
Case Western Reserve University
910.553.4224; Cell: 216.312.3203

*?People have the mistaken impression that mathematics is just equations,
In fact, equations are just the boring part of mathematics."*

        *? *Stephen W. Hawking, 1942-2018






On Mon, Apr 30, 2018 at 11:46 AM, Dennis Fisher <fisher at plessthan.com>
wrote:

  
  
#
Dennis,

unfortunately, the Quartz windows are always placed at the same coordinates 100 x 100 and there is no option to change that.

However, you can move it around using the Cocoa package if you so desire (assuming you're in the R.app):

install.packages("Cocoa",,"http://rforge.net")

library(Cocoa)

## create a quartz device and get its window
## make sure you run the following as one command or else you'll get the console window instead
quartz(); w = .M(.M("NSApplication", "sharedApplication"), "keyWindow")

## move the window:
.M(w, "setFrameTopLeftPoint:", NSMakePoint(100, 1000))


You can move it anywhere on any screen - also off-screen.

The other alternative is to move it using AppleScript.

Cheers,
Simon
#
Simon

The Cocoa suggestion should address my need ? thanks so much.

Dennis

Dennis Fisher MD
P < (The "P Less Than" Company)
Phone / Fax: 1-866-PLessThan (1-866-753-7784)
www.PLessThan.com <http://www.plessthan.com/>