Peter, thank you, that's what I was looking for!
David, I forgot to tell you my OS. Sorry... it's Win7. I'm running a RKWard session. And this is strange: > Cairo("example.pdf", type="pdf",width=12,height=12,units="cm",dpi=300) Error: could not find function "Cairo" ... maybe you're not using the Cairo package? http://cran.r-project.org/web/packages/Cairo/Cairo.pdf And Dennis, thanks for the code. It worked, and I'm considering to adopt data frames in the near future. By the way, I'm working with functional time series, so each observation is a function (or a vector representing that function evaluated on a grid) indexed by time. Any insights on how to implement data frames here? Best regards, Eduardo On Thu, Jan 6, 2011 at 1:47 AM, Peter Langfelder <peter.langfel...@gmail.com > wrote: > On Wed, Jan 5, 2011 at 7:35 PM, Eduardo de Oliveira Horta > <eduardo.oliveiraho...@gmail.com> wrote: > > Something like this: > > > > u=seq(from=-pi, to=pi, length=1000) > > f=sin(u) > > Cairo("example.pdf", type="pdf",width=12,height=12,units="cm",dpi=300) > > par(cex.axis=.6,col.axis="grey",ann=FALSE, lwd=.25,bty="n", las=1, > tcl=-.2, > > mgp=c(3,.5,0)) > > xlim=c(-pi,pi) > > ylim=round(c(min(f),max(f))) > > plot(u,f,xlim,ylim,type="l",col="firebrick3", axes=FALSE) > > axis(side=1, lwd=.25, col="darkgrey", at=seq(from=xlim[1], to=xlim[2], > > length=5)) > > axis(side=2, lwd=.25, col="darkgrey", at=seq(from=ylim[1], to=ylim[2], > > length=5)) > > abline(v=seq(from=xlim[1], to=xlim[2], length=5), lwd=.25,lty="dotted", > > col="grey") > > abline(h=seq(from=ylim[1], to=ylim[2], length=5), lwd=.25,lty="dotted", > > col="grey") > > dev.off() > > > > > > > Wow, you must like light colors :) > > To the point, just set margins, for example > > par(mar = c(2,2,0.5, 0.5)) > > (margins are bottom, left, top, right) > > after the Cairo command. > > BTW, Cairo doesn't work for me either... but I tried your example by > plotting to the screen. > > Peter > > > > > Notice how the canvas' margins are relatively far from the plotting area. > > > > Thanks, > > > > Eduardo > > > > On Thu, Jan 6, 2011 at 1:00 AM, David Winsemius <dwinsem...@comcast.net > >wrote: > > > >> > >> On Jan 5, 2011, at 9:38 PM, Eduardo de Oliveira Horta wrote: > >> > >> Hello, > >>> > >>> I want to save a pdf plot using Cairo, but the canvas of the saved file > >>> seems too large when compared to the actual plotted area. > >>> > >>> Is there a way to control the relation between the canvas size and the > >>> size > >>> of actual plotting area? > >>> > >>> > >> OS?, ... example? > >> > >> == > >> > >> David Winsemius, MD > >> West Hartford, CT > >> > >> > > > > [[alternative HTML version deleted]] > > > > ______________________________________________ > > 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. > > > [[alternative HTML version deleted]] ______________________________________________ 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.