[R] creating pdf of wireframe

jculbertson culbertson at cogsci.jhu.edu
Mon Aug 9 22:25:47 CEST 2010


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.

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.



More information about the R-help mailing list