[R] vector graphics/ SVG plots via RSvgDevice

Sam McClatchie sam.mcclatchie at earthlink.net
Mon Nov 5 18:28:09 CET 2007


System:
Linux Ubuntu 7.10 Gibbon
kernel  2.6.22-14-generic
Emacs ver. 22.1.1
ESS ver. 5.3.0
R version 2.6.0 (2007-10-03)
------------------------------------------------

Colleagues

This is a follow-up note to my earlier post under this header, giving my
solution.

First, with some trepidation I upgraded my ubuntu distro, and this time
did a full reinstall, so I did not break my system, as I have done in
the past.

Then I tried to get the contributed package Cairo to work, but still had
issues with libraries that I failed to fix. However, the upgrade had
other advantages. Thanks for the push, Brian.

I went back to RSvgDevice and produced nice SVG plots that imported into
Inkscape and could be edited to meet all the fussy journal requirements
for my figures. However, both the Inkscape and the plain SVG files did
not display properly on conversion from LyX to DVI or PDF, although they
look fine in LyX. My work around is to export a bitmap from Inkscape and
use this in LyX. Export creates a PNG file, and an advantage here is
that the graphics file size reduced from  2.1 MB for the SVG file to 320
KB for the PNG file.  This is good where the journal wants your graphics
files separately and may not be  able to deal with SVG files, or very
large files.

I have one caveat. It seems to me that RSvgDevice had problems writing
to file when the data were unreasonably voluminous. I produced another
graphic using bathymetry and coastlines recommended in the PBSmapping
package. These files are high resolution and large (85 and 64 MB
respectively). The plot took too long and the resulting SVG could not be
loaded by Inkscape, nor converted to EPS using Image Magick (suggesting
failure somewhere?).  I'm not criticizing the packages here, just making
an observation. I can either create smaller bathymetry and coastline
files, or use the big linux beast downstairs.

Best fishes

Sam

-- 
Sam McClatchie (Fisheries oceanographer, SWFSC, NOAA)
& Elena Turin (Internal controls accountant, UCSD)
work: SWFSC, 8604 La Jolla Shores Drive, La Jolla, CA 92037-1508, USA
home: 12723 Salmon River Rd, San Diego, CA 92129, USA
web: <http://www.fishocean.info>
Sam's cell: 858 752 8495
Elena's cell: 858 752 8689
                  /\
       >><xX(&>
               /// \\\
              //// \\\\
             ///  <%)Xx><<
            /////  \\\\\\
      ><(((@>
><(((%>      ..>><xX(?>O<?)Xx><<



More information about the R-help mailing list