How do I make a picture that is a horizontal strip? I tried> plot(x=c(1,2,3,4),y=c(1,1,1,1)) #works but screen image is square. > pdf("ratio.pdf",height=1,width=6) > plot(x=c(1,2,3,4),y=c(1,1,1,1))I got the following error message: Error in plot.new() : figure margins too large Is it possible to produce an on-screen picture that is a horizontal strip? (I use Mac Os X 10.4.11, and quartz().) What about pdf? I have spent many hours trawling through the online help information and this forum, without success. Where is this explained? Thanks for any help David -- View this message in context: http://www.nabble.com/Making-a-picture-that-is-wide-and-small-height-tp20808401p20808401.html Sent from the R help mailing list archive at Nabble.com.
Prof Brian Ripley
2008-Dec-03 08:23 UTC
[R] Making a picture that is wide and small height
On Tue, 2 Dec 2008, David Epstein wrote:> > How do I make a picture that is a horizontal strip? I tried > >> plot(x=c(1,2,3,4),y=c(1,1,1,1)) #works but screen image is square. >> pdf("ratio.pdf",height=1,width=6) >> plot(x=c(1,2,3,4),y=c(1,1,1,1)) > I got the following error message: > Error in plot.new() : figure margins too large > > Is it possible to produce an on-screen picture that is a horizontal strip? > (I use Mac Os X 10.4.11, and quartz().) What about pdf? > > I have spent many hours trawling through the online help information and > this forum, without success. Where is this explained?In 'An Introduction to R', chapter 12. You need to use smaller margins, and either omit the axes or use smaller text (reduce 'pointsize') which will do so automatically. E.g.> quartz(height=1, width=6, pointsize=5) > plot(x=c(1,2,3,4),y=c(1,1,1,1))works for me, and you might want something like> par(mar=rep(2.1,4)) > plot(x=c(1,2,3,4),y=c(1,1,1,1), xlab="", ylab="")> Thanks for any help > David-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
Look at the squishplot function in the TeachingDemos package, that may do what you want. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.snow at imail.org 801.408.8111> -----Original Message----- > From: r-help-bounces at r-project.org [mailto:r-help-bounces at r- > project.org] On Behalf Of David Epstein > Sent: Wednesday, December 03, 2008 1:00 AM > To: r-help at r-project.org > Subject: [R] Making a picture that is wide and small height > > > How do I make a picture that is a horizontal strip? I tried > > > plot(x=c(1,2,3,4),y=c(1,1,1,1)) #works but screen image is square. > > pdf("ratio.pdf",height=1,width=6) > > plot(x=c(1,2,3,4),y=c(1,1,1,1)) > I got the following error message: > Error in plot.new() : figure margins too large > > Is it possible to produce an on-screen picture that is a horizontal > strip? > (I use Mac Os X 10.4.11, and quartz().) What about pdf? > > I have spent many hours trawling through the online help information > and > this forum, without success. Where is this explained? > > Thanks for any help > David > > -- > View this message in context: http://www.nabble.com/Making-a-picture- > that-is-wide-and-small-height-tp20808401p20808401.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at 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.