[R] interaction.plot - gridlines and formatting legend title...

Dimitri Liakhovitski ld7631 at gmail.com
Wed Feb 18 23:18:13 CET 2009


Thank you for providing advice on this graphics question.

I am building an interaction.plot.

d=data.frame(xx=c(3,3,2,2,1,1),yy=c(4,3,4,3,4,3),zz=c(5.1,4.2,4.4,3.5,3.3,-1.1,-1.3)
d[[1]]<-as.factor(d[[1]])
d[[2]]<-as.factor(d[[2]])
print(d)
interaction.plot(d$xx, d$yy, d$zz,
   type="b", col=c("red","blue"), legend=F,
   lty=c(1,2), lwd=2, pch=c(18,24),
   xlab="X Label",
   ylab="Y Label",
   main="Chart Label")
legend("bottomright", c("level 1","level
2"),bty="n",lty=c(1,2),lwd=2,pch=c(18,24),
col=c("red","blue"), title="Legend Title",inset = .02)

I think it is not using lattice, does it? So, I was wondering if it is
at all possible to:

1. Create gridlines in an interaction.plot
2. Define the font type of the legend title (e.g., regular vs. bold as
in font=2)
3. Put actual values (on Y) next to each point in the graph.

Thank you so much for your advice!


-- 
Dimitri Liakhovitski
MarketTools, Inc.
Dimitri.Liakhovitski at markettools.com




More information about the R-help mailing list