[R-SIG-Mac] Miniature plot windows

Simon Urbanek @|mon@urb@nek @end|ng |rom R-project@org
Mon Jan 22 22:27:07 CET 2024


Erik,

thanks, this is very unusual. Can you, please, send me more details about your setup? Please run the following two lines in Terminal and send me the full output:

system_profiler SPHardwareDataType | grep Model
system_profiler SPDisplaysDataType

Then in R run the following code and also include the result:

inline::cfunction(,'CGDirectDisplayID md = CGMainDisplayID(); CGSize ds = CGDisplayScreenSize(md); Rprintf("%.2f x %.2f -> %d x %d\\n", ds.width/25.4, ds.height/25.4, (int)CGDisplayPixelsWide(md), (int)CGDisplayPixelsHigh(md)); return R_NilValue;','#include <ApplicationServices/ApplicationServices.h>')()

This should result in something like this (install the inline package if you don't have it and you will also need command line tools which you can get by running
xcode-select --install
in Terminal if you don't have them):

> inline::cfunction(,'CGDirectDisplayID md = CGMainDisplayID(); CGSize ds = CGDisplayScreenSize(md); Rprintf("%.2f x %.2f -> %d x %d\\n", ds.width/25.4, ds.height/25.4, (int)CGDisplayPixelsWide(md), (int)CGDisplayPixelsHigh(md)); return R_NilValue;','#include <ApplicationServices/ApplicationServices.h>')()
23.54 x 13.24 -> 2048 x 1152

This shows the physical size of the screen (in inches) and the current resolution.

The Quartz dpi setting is NULL by default which means "detect from hardware" which works on all Macs I have seen so the fact that it is way off is odd. The code above is how the dimensions are determined.

Cheers,
Simon

PS: if the email processing mangled the above code here is a broken-down version that hopefully doesn't get mangled:

inline::cfunction(,'CGDirectDisplayID md = CGMainDisplayID();
CGSize ds = CGDisplayScreenSize(md);
Rprintf("%.2f x %.2f -> %d x %d\\n", ds.width/25.4, ds.height/25.4,
  (int)CGDisplayPixelsWide(md), (int)CGDisplayPixelsHigh(md));
return R_NilValue;',
'#include <ApplicationServices/ApplicationServices.h>')()



> On Jan 23, 2024, at 3:41 AM, Wright, Erik Scott <ESWRIGHT using pitt.edu> wrote:
> 
> Hi all,
> 
> I recently upgraded to a new Macbook Pro (Nov 23). Now every plot is miniaturized.
> 
> For example, my screen measures about 13.5" x 8.8" with a ruler. When I create a new plot with plot(1:10) or quartz(height=7, width=7), the plot measures 2.0" x 2.0".
> 
> It is simple enough to initialize larger plot windows with dev.new or quartz(height=24.5, width=24.5), but the points and font stay miniaturized. Of course, I could rescale every single plot feature by 3.5-fold, but that seems like an inefficient solution.
> 
> Any suggestions would be appreciated.
> 
> Erik
> 
> R version 4.3.2 (2023-10-31)
> Platform: aarch64-apple-darwin20 (64-bit)
> Running under: macOS Sonoma 14.2.1
> 
> _______________________________________________
> R-SIG-Mac mailing list
> R-SIG-Mac using r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
> 



More information about the R-SIG-Mac mailing list