[R] Fine Tuning Plotrix

Lorenzo Isella lorenzo.isella at gmail.com
Wed Mar 10 00:12:05 CET 2010


Dear All,
Please see the code snippet at the end of the email.
I am using the color2D.matplot in Plotrix to plot a matrix.
It works great, but there are a few things I cannot figure out

(1) the value of cex.axis in the code snippet does not seem to affect 
the final pdf at all (at least on my system, Ubuntu 9.10, plotrix and 
Cairo installed from cran). How do I specify the size of the axis ticks 
and the corresponding numbers?
(2) Can I specify the number of decimal figures in the max/min value in 
the legend?
(3) Can I replace the numbers along the x-axis with e.g. 
c('a','b','c','d','e')?
(4) Do I need to resort to color.legend if e.g. I want to rotate the 
legend and align it to the y axis?

Many thanks

Lorenzo

############################################################

rm(list=ls())
library(Cairo)
library(plotrix)

set.seed(1234)

trivial_matrix<-matrix(rnorm(25),nrow=5)

CairoPDF("matrix2D.pdf")
par( mar = c(4.5,5, 2, 1) + 0.1)

color2D.matplot(trivial_matrix,main="A trivial Plot",xlab = 
expression(paste(k)),
ylab=expression(paste(R[g])),cex.axis=1.4,cex.lab=1.6, cex.main=1.6, 
show.legend=TRUE, show.values=1,vcol="blue",
                vcex=1, axes=TRUE)
dev.off()



More information about the R-help mailing list