Re: [R] positions and margins differ between X11 and SVG device
Thanks Allen, my R installation: platform i686-pc-linux-gnu arch i686 os linux-gnu system i686, linux-gnu status major 2 minor 11.1 year 2010 month 05 day31 svn rev52157 language R version.string R version 2.11.1 (2010-05-31) and Cairo: Package: Cairo Version: 1.4-5 I have the problem with both, svg() and CairoSVG() Yes, I guess I could increase the canvas size until I can see all labels and then move them around in inkscape. I was just wondering if there was a better way of doing this as it seems like a rather hacky solution for what must be a very common problem. Particularly frustrating if you can see the desired result in the x11 device but you can't export it to a high-quality format. Cheers, Frank -- View this message in context: http://r.789695.n4.nabble.com/positions-and-margins-differ-between-X11-and-SVG-device-tp3341854p3343630.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] positions and margins differ between X11 and SVG device
Hi, I'm trying to get a plot ready for publication, which involves getting it to look nice at a rather small size and to fine-tune positioning all the labels and sizes of the margins. I realise that I may not be doing this the right way and I welcome any comments about better approaches to do this. What I have done so far is open an X11 device with the size I want for the final output and I have now managed to arrange all the elements as I wanted in the R script that draws the plot. Saving the plot to a bitmap format preserves all the positions and sizes but the resulting quality is too low. Saving it to svg (also tried CairoSVG) of course gives me excellent quality, but the positions and margins are all completely different from the X11 window. Now I'm wondering how others deal with this (surely common) situation? Figuring out the positions while working blindly (saving to svg file all the time and opening it again to see the result) surely can't be the way to adjust the positions. But what else can I do if X11 output and svg differ so much? In fact, here is a toy example to demonstrate the differences: x1=seq(0,2,by=0.01) y1=2*sin(2*pi*(x1-1/4)) x11(width=1.67, height=2.28) plot(x1,y1) # looks completely different in svg (at least on my machine): CairoSVG(file=test.svg, width=1.67, height=2.28) plot(x1,y1) dev.off() Any help or general advice on formatting plots for publication would be very welcome! Cheers, Frank -- The Wellcome Trust Sanger Institute is operated by Genome Research Limited, a charity registered in England with number 1021457 and a company registered in England with number 2742969, whose registered office is 215 Euston Road, London, NW1 2BE. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] positions and margins differ between X11 and SVG device
Looks the same on my machine, albeit using svg() instead of CairoSVG - what version are you using? One sometimes useful technique is to create the first graphics in a vector format (pdf, svg) and then use an editing program like Inkscape or Illustrator to do any touch-up before publication, as well as resizing and format conversion. Good luck! Allan On 08/03/11 17:02, Frank Schwach wrote: Hi, I'm trying to get a plot ready for publication, which involves getting it to look nice at a rather small size and to fine-tune positioning all the labels and sizes of the margins. I realise that I may not be doing this the right way and I welcome any comments about better approaches to do this. What I have done so far is open an X11 device with the size I want for the final output and I have now managed to arrange all the elements as I wanted in the R script that draws the plot. Saving the plot to a bitmap format preserves all the positions and sizes but the resulting quality is too low. Saving it to svg (also tried CairoSVG) of course gives me excellent quality, but the positions and margins are all completely different from the X11 window. Now I'm wondering how others deal with this (surely common) situation? Figuring out the positions while working blindly (saving to svg file all the time and opening it again to see the result) surely can't be the way to adjust the positions. But what else can I do if X11 output and svg differ so much? In fact, here is a toy example to demonstrate the differences: x1=seq(0,2,by=0.01) y1=2*sin(2*pi*(x1-1/4)) x11(width=1.67, height=2.28) plot(x1,y1) # looks completely different in svg (at least on my machine): CairoSVG(file=test.svg, width=1.67, height=2.28) plot(x1,y1) dev.off() Any help or general advice on formatting plots for publication would be very welcome! Cheers, Frank __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.