Gundala Viswanath
2008-Jun-20 05:37 UTC
[R] Howto reduce number of ticks in X, Y axis while still containing all the data
Hi I am trying to plot 100 x 100 matrix data in a level plot. The problem I have is that the x/y -axis label in ticks are jumbled together. Thus I want X/Y axis to contain 10 ticks only, yet still plotting all the 100 data. Is there a way to do it? The code I have below doesn't work. __BEGIN__ # Corr contains 100x100 matrix corr <- cor(t(mat.data), method ="pearson") # Plot them levelplot(corr, main="PCC of Top-100 Genes", xlab="Gene", ylab="Gene", scale=list(y=list(tick.number=10)) # Doesn't work ) - Gundala Viswanath Jakarta - Indonesia
Dieter Menne
2008-Jun-20 06:38 UTC
[R] Howto reduce number of ticks in X, Y axis while still containing all the data
Gundala Viswanath <gundalav <at> gmail.com> writes:> I am trying to plot 100 x 100 matrix data in a level plot. > The problem I have is that the x/y -axis label in ticks > are jumbled together. Thus I want X/Y axis to contain > 10 ticks only, yet still plotting all the 100 data. > > Is there a way to do it? > The code I have below doesn't work. >Well, the code did not work because you did not provide example data and forgot that levelplot is lattice, but when I add these two lines, it works for me. Scaling is 20,40,..., and all point are shown (hope so, I did not count). Dieter library(lattice) mat.data = matrix(rnorm(100*100),nrow=100) # Corr contains 100x100 matrix corr <- cor(t(mat.data), method ="pearson") # Plot them levelplot(corr, main="PCC of Top-100 Genes", xlab="Gene", ylab="Gene", scale=list(y=list(tick.number=10)) # Doesn't work )