Note that there are at least 5 separate png() devices, so Linux was not using the (default) device used on Windows. In general, the device-limits info is not on the help page because we do not know it. On Windows the default device limits depend on the OS version, 32/64-bit, RAM and the graphics hardware. This sounds like the last: you were asking for 49 megapixels which is far larger than the largest screens. (Or all but the highest-end digital cameras, so one could well ask what you can usefully do with such an image.) Normally you will get warning(s) accompanying that Error, but it might just be Warning: unable to allocate bitmap Warning: opening device failed The first of those is reporting what the GraphApp toolkit said, talking directly to Windows GDI (and look at the Windows documentation for e.g. CreateCompatibleBitmap to see that no limits are mentioned). Even on Windows you have the option of using other png() devices: png(filename = "Rplot03d.png", width = 480, height = 480, units = "px", pointsize = 12, bg = "white", res = NA, family = "", restoreConsole = TRUE, type = c("windows", "cairo", "cairo-png"), antialias) Try the other 2 types: the cairo devices do not use your graphics hardware nor MicroSoft's GDI. (The other 2 devices are Xlib on a Unix-alike and Quartz on macOS.) On 10/02/2017 16:54, Martin Maechler wrote:>>>>>> Dario Strbenac <dstr7320 at uni.sydney.edu.au> >>>>>> on Fri, 10 Feb 2017 02:00:08 +0000 writes: > > > Good day, > > Could the documentation of graphics devices give some explanation of how big the bitmap limits are? For example, > > >> png("Figure1A.png", h = 7, w = 7, res = 1000, units = "cm") > > > Results in Error: unable to start png() device, > > This is amazing to me. I see > > ------------------------------------------------------------------------------ >> png("Figure1A.png", h = 7, w = 7, res = 1000, units = "cm") >> plot(1) >> dev.off() > null device > 1 >> file.info("Figure1A.png")[1:5] > size isdir mode mtime ctime > Figure1A.png 41272 FALSE 644 2017-02-10 17:40:42 2017-02-10 17:40:42 >> > ------------------------------------------------------------------------------ > > in three different versions of R I've tried (all were 64-bit Linux). > Note how *small* the file is. > Now, I've also tried a 32-bit version of Linux (Ubuntu 14.04 LTS) and get > a similar result (not exactly the same number of bytes for the file size). > > >> but the help page of devices doesn't explain that there are any limits or how they are determined. The wording of the error message could also be improved, to explain that the resolution is too high or the dimensions are too large. > > If one/some of those who can reproduce the problem in their > versions of R provide (concise and not hard to read) patches to > the source of R, we'd probably gratefully accept them.. > > Martin Maechler > > >> sessionInfo() > > R version 3.3.2 Patched (2017-02-07 r72138) > > Platform: i386-w64-mingw32/i386 (32-bit) > > Running under: Windows 7 (build 7601) Service Pack 1 > > > -------------------------------------- > > Dario Strbenac > > University of Sydney > > Camperdown NSW 2050 > > Australia-- Brian D. Ripley, ripley at stats.ox.ac.uk Emeritus Professor of Applied Statistics, University of Oxford
On 10/02/2017 19:27, Prof Brian Ripley wrote:> Note that there are at least 5 separate png() devices, so Linux was not > using the (default) device used on Windows. > > In general, the device-limits info is not on the help page because we do > not know it. On Windows the default device limits depend on the OS > version, 32/64-bit, RAM and the graphics hardware. This sounds like the > last: you were asking for 49 megapixels which is far larger than the > largest screens. (Or all but the highest-end digital cameras, so one > could well ask what you can usefully do with such an image.)Scratch that: res is in ppi so the image should be 2755px square: still rather large.> Normally you will get warning(s) accompanying that Error, but it might > just be > > Warning: unable to allocate bitmap > Warning: opening device failed > > The first of those is reporting what the GraphApp toolkit said, talking > directly to Windows GDI (and look at the Windows documentation for e.g. > CreateCompatibleBitmap to see that no limits are mentioned). > > > Even on Windows you have the option of using other png() devices: > > png(filename = "Rplot03d.png", > width = 480, height = 480, units = "px", pointsize = 12, > bg = "white", res = NA, family = "", restoreConsole = TRUE, > type = c("windows", "cairo", "cairo-png"), antialias) > > Try the other 2 types: the cairo devices do not use your graphics > hardware nor MicroSoft's GDI. (The other 2 devices are Xlib on a > Unix-alike and Quartz on macOS.) > > > On 10/02/2017 16:54, Martin Maechler wrote: >>>>>>> Dario Strbenac <dstr7320 at uni.sydney.edu.au> >>>>>>> on Fri, 10 Feb 2017 02:00:08 +0000 writes: >> >> > Good day, >> > Could the documentation of graphics devices give some >> explanation of how big the bitmap limits are? For example, >> >> >> png("Figure1A.png", h = 7, w = 7, res = 1000, units = "cm") >> >> > Results in Error: unable to start png() device, >> >> This is amazing to me. I see >> >> ------------------------------------------------------------------------------ >> >>> png("Figure1A.png", h = 7, w = 7, res = 1000, units = "cm") >>> plot(1) >>> dev.off() >> null device >> 1 >>> file.info("Figure1A.png")[1:5] >> size isdir mode mtime ctime >> Figure1A.png 41272 FALSE 644 2017-02-10 17:40:42 2017-02-10 17:40:42 >>> >> ------------------------------------------------------------------------------ >> >> >> in three different versions of R I've tried (all were 64-bit Linux). >> Note how *small* the file is. >> Now, I've also tried a 32-bit version of Linux (Ubuntu 14.04 LTS) and get >> a similar result (not exactly the same number of bytes for the file >> size). >> >> >>> but the help page of devices doesn't explain that there are any >>> limits or how they are determined. The wording of the error message >>> could also be improved, to explain that the resolution is too high or >>> the dimensions are too large. >> >> If one/some of those who can reproduce the problem in their >> versions of R provide (concise and not hard to read) patches to >> the source of R, we'd probably gratefully accept them.. >> >> Martin Maechler >> >> >> sessionInfo() >> > R version 3.3.2 Patched (2017-02-07 r72138) >> > Platform: i386-w64-mingw32/i386 (32-bit) >> > Running under: Windows 7 (build 7601) Service Pack 1 >> >> > -------------------------------------- >> > Dario Strbenac >> > University of Sydney >> > Camperdown NSW 2050 >> > Australia >-- Brian D. Ripley, ripley at stats.ox.ac.uk Emeritus Professor of Applied Statistics, University of Oxford
Good day,> In general, the device-limits info is not on the help page because we do not know it.It seems like it would be near-impossible to do in a cross-platform way.> Normally you will get warning(s) accompanying that Error ... > Warning: unable to allocate bitmap > Warning: opening device failedYes, I saw those but omitted them from the question.> Note that there are at least 5 separate png() devices, so Linux was not using the (default) device used on Windows.That explains it.> Try the other 2 types: the cairo devices do not use your graphics hardware nor MicroSoft's GDI.Indeed, it works with the cairo backend.> ... one could well ask what you can usefully do with such an image.Unfortunately, some scientific journals have unrealistic figure requirements, e.g. http://www.jidonline.org/content/authorinfo#idp1498768 -------------------------------------- Dario Strbenac University of Sydney Camperdown NSW 2050 Australia
Maybe Matching Threads
- Grapics Device Resolution Limits
- Grapics Device Resolution Limits
- Grapics Device Resolution Limits
- [Bug 93932] New: Xorg/Nouveau crashes with Segmentation fault when setting i7-Skylake iGPU as primary grapics device in BIOS
- R Package Installation Ignores libPaths Setting