1

I am having issues with saving a ggplot generated graph after install R from source on Ubuntu 10.04.

For instance the following:

library(ggplot2)
head(diamonds)
p <- ggplot(data = diamonds, aes(x = carat, y = price, colour = cut)) + layer(geom = "point")
p <- p + layer(geom = "point")
ggsave("plot.svg")

Results in:

Saving 7 x 7 in image
Warning messages:
1: In grDevices::svg(...) : unable to load shared object 
  '/app/vendor/R/lib64/R/library/grDevices/libs//cairo.so':
    libpng15.so.15: cannot open shared object file: No such file or directory
2: In grDevices::svg(...) : failed to load cairo DLL

cairo.so is present at: /app/vendor/R/lib64/R/library/grDevices/libs/cairo.so

libpng15.so.15 is present at: /app/vendor/libpng/lib/libpng15.so.15

Running capabilities() yields:

> capabilities()
jpeg      png     tiff    tcltk      X11     aqua http/ftp  sockets
TRUE     TRUE     TRUE    FALSE    FALSE    FALSE     TRUE     TRUE
libxml     fifo   cledit    iconv      NLS  profmem    cairo
  TRUE     TRUE     TRUE     TRUE     TRUE    FALSE     TRUE

I'm at a bit of a loss as to what may be going wrong here, maybe it is something to do with the location of my libpng15.so.15 file?

2
  • Are you on 10.04 desktop or 10.04 server edition?
    – Dason
    Jun 14, 2014 at 23:49
  • Check if libpng is present in an environmental variable LD_LIBRARY_PATH. If not, you may either reinstall libpng or create a symbolic link ln -s /path/to/libpng /usr/lib.
    – tonytonov
    Jun 15, 2014 at 6:46

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.