[R] creating pdf of wireframe

Deepayan Sarkar deepayan.sarkar at gmail.com
Tue Aug 17 11:42:07 CEST 2010


On Tue, Aug 10, 2010 at 1:55 AM, jculbertson <culbertson at cogsci.jhu.edu> wrote:
>
> Dear R list,
> I have written some code to produce several wireframe plots in a panel. They
> look good, but when I try to create a pdf, many (but not all) of the details
> I have specified are not reproduced. For example, the line width I have
> specified is not reproduced, and neither are the font sizes for the axis
> labels. I'm an R novice, so I could really use some guidance.

"Not reproduced" in what sense? Works for me.

Note that if you are using Acrobat Reader to view the PDF file, you
may need to go to Edit->Preferences->Page Display and uncheck the box
for "Enhance thin lines".

-Deepayan


>
> Here is the code I am using (post1, post2, post3 are 3-dimensional
> matrices):
>
> newcols <- colorRampPalette(c("grey90", "grey10")) #generates palette frome
> light to dark grey for better visibility
>
> trellis.device(pdf,file="PostAll.pdf", width = 5, height = 5)
> trellis.par.set("plot.line", list(lwd=0.15));
>
> top.left <- wireframe(post1, xlab=list("p(adj-N)", cex=.7,
> rot=30),ylab=list("p(num-N)", cex=.7, rot=-45),zlab=list("posterior",
> cex=.7, rot=90),col.regions=newcols(100), drape=TRUE,colorkey=TRUE,
> lwd=0.15, zoom=1, scales = list(z = list(distance = 0.5), x = list(distance
> = 0.5), y = list(distance = 0.5)));
>
> top.right <- wireframe(post2, xlab=list("p(adj-N)", cex=.7,
> rot=30),ylab=list("p(num-N)", cex=.7, rot=-45),zlab=list("posterior",
> cex=.7, rot=90),col.regions=newcols(100), drape=TRUE,colorkey=TRUE,
> lwd=0.15, zoom=1, scales = list(z = list(distance = 0.5), x = list(distance
> = 0.5), y = list(distance = 0.5)));
>
> bottom.left <- wireframe(post3, xlab=list("p(adj-N)", cex=.7,
> rot=30),ylab=list("p(num-N)", cex=.7, rot=-45),zlab=list("posterior",
> cex=.7, rot=90),col.regions=newcols(100), drape=TRUE,colorkey=TRUE,
> lwd=0.15, zoom=1, scales = list(z = list(distance = 0.5), x = list(distance
> = 0.5), y = list(distance = 0.5)));
>
> bottom.right <- wireframe(post4, xlab=list("p(adj-N)", cex=.7,
> rot=30),ylab=list("p(num-N)", cex=.7, rot=-45),zlab=list("posterior",
> cex=.7, rot=90),col.regions=newcols(100), drape=TRUE,colorkey=TRUE,
> lwd=0.15, zoom=1, scales = list(z = list(distance = 0.5), x = list(distance
> = 0.5), y = list(distance = 0.5)));
>
> print(top.left, split=c(1,1,2,2), more=TRUE )
> print(top.right, split=c(2,1,2,2), more=TRUE )
> print(bottom.left, split=c(1,2,2,2), more=TRUE)
> print(bottom.right, split=c(2,2,2,2))
>
> dev.off()
>
> Thanks for your help,
> -Jenny
>
> --
> View this message in context: http://r.789695.n4.nabble.com/creating-pdf-of-wireframe-tp2319017p2319017.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.
>



More information about the R-help mailing list