Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

roary R plots don't work on server --- lack of X11 #194

Closed
andersgs opened this issue Nov 1, 2015 · 2 comments
Closed

roary R plots don't work on server --- lack of X11 #194

andersgs opened this issue Nov 1, 2015 · 2 comments
Labels

Comments

@andersgs
Copy link

andersgs commented Nov 1, 2015

Hi. Great software. Unfortunately, when running on the server with no X11, obtaining the PNG plots runs into the following problem:

Error in .External2(C_X11, paste("png::", filename, sep = ""), g$width, :
unable to start device PNG
In addition: Warning message:
In png("test.png") : unable to open connection to X11 display ''

The same does not occur if the plot is a PDF or bitmap:

bitmap(filename,"png16m")

This would still generate a readable PNG.

Or:

pdf(filename)

Thank you.

Anders.

@andrewjpage andrewjpage added the bug label Nov 1, 2015
@tseemann
Copy link
Contributor

tseemann commented Nov 1, 2015

@andersgs

  1. Is it enough to SSH without X11 forwarding (-X / -Y) to reproduce this?
  2. could it be a libpng issue? RHEL using 1.5.x and Brew using 1.6.x ?
  3. Does using the bitmap function make it easier to change the output format?

@andersgs
Copy link
Author

andersgs commented Nov 1, 2015

@tseemann

  1. Yes. Stack exchange if filled with question about this problem. Solutions are employ X11 forwarding, or change the format. I have run in to it in other scripts I have written myself.
  2. It could, but I don't think so. By default the png() functions generates the image using a X11/quartz device (depending on OS). You can change the behaviour to use a cairo device, but that requires installing Cairo, and it isn't clear to me that it would help.
  3. bitmap() is based on ghostscript, and:
    The types available will depend on the version of ghostscript, but are likely to include "jpeg", "jpegcmyk", "jpeggray", "tiffcrle", "tiffg3", "tiffg32d", "tiffg4", "tiffgray", "tifflzw", "tiffpack", "tiff12nc", "tiff24nc", "tiff32nc" "png16", "png16m", "png256", "png48", "pngmono", "pnggray", "pngalpha", "bmp16", "bmp16m" "bmp256", "bmp32b", "bmpgray", "bmp mono".

I have tested the bitmap() option on the server I have access to, and it works --- as long as ghostscript is installed --- I am not sure how often ghostcript is installed by default, but I assume it generally is on most linux distros(?). More info on bitmap() here.

That said, it might also be able to be fixed by changing how R is compiled. The capabilities() function reports on:
the optional features which have been compiled into this build of R.

And, in my case, my server reports the following:

    jpeg         png        tiff       tcltk         X11        aqua

  FALSE       FALSE       FALSE        TRUE       FALSE       FALSE

   http/ftp     sockets      libxml        fifo      credit       iconv

   TRUE        TRUE        TRUE        TRUE       FALSE        TRUE

    NLS     profmem       cairo         ICU long.double

   TRUE        TRUE       FALSE        TRUE        TRUE

But, that does not seem like a very user friendly-option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants