[R] How do I change the colour and format for the trelli plot ?

ychu066 ychu066 at aucklanduni.ac.nz
Thu Nov 19 02:41:29 CET 2009


I have solved the first problem by using layout=c(1,3) 

but still cant find the solution for the next problem of getting differenct
colour for the bars in the 3 different histogram plots....


ychu066 wrote:
> 
>  http://old.nabble.com/file/p26418382/hist1.png hist1.png  i want three
> plots along on the side , how to i do that ?
> 
>  and I also want to change the colour of the bars for each plot, how do i
> do that ?
> 
> i got the code here to draw that ..
> columns <- 8:153 
> plots <- vector("list", length(columns)) 
> j <- 0 
> for (i in columns) 
> {   
>   plots[[ j <- j+1 ]] <- 
>     histogram( ~ data[,i], 
>       ylab = "Frequency", xlab = "Score", 
>       xlim = c(1,5), ylim = c(0,100), 
>       main = colnames(data)[i]
>     ) 
> } 
> 
> print(plots[[1]]) 
> 
> # or export 
> 
> for (i in seq_along(plots)) 
> { 
>   png(paste("hist", i, ".png", sep = "")) 
>   print(plots[[i]]) 
>   dev.off() 
> } 
> 

-- 
View this message in context: http://old.nabble.com/How-do-I-change-the-colour-and-format-for-the-trelli-plot---tp26418382p26419007.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list