Entering edit mode
                    Arne.Muller@aventis.com
        
    
        ▴
    
    620
        @arnemulleraventiscom-466
        Last seen 11.2 years ago
        
    Hello,
I've a problem aligning tickmarks to an image. I've created a
correlation matrix for 84 affy mouse chips. I'm visualizing the matrix
as an image with colour coding according to the correlation
coefficient.
The 84 chips are distributed over three factors, but the desgin is
unbalanced, so that the tickarks and the lables for the axis are must
not evenly distributed. A regular grid via the 'grid' function aligns
perfectly with the image cells, but the tickmarks seem to be shifted,
and not aligned perfectly with the image cells. This offset is even
stonger for the y-axis. The thing is that I don't want 84 lables at
the axis, it's enough to have one lable for all the different factor
level combinations, which results in 28 labels.
Maybe you have an idea how to setup the command to align the tick
marks.
        kind regards,
        Arne
Here are my commands:
> library(marrayPlots) # for the colors
> col <- maPalette(low='white', high='darkred', k=50)
> par(ps=8, cex=1, mar=c(1,5,5,1)) # space needed for lables @ axis 1
and 3
# a x and y tange from 1 to 84, x is the correlation matrix (dim =
84x84)
> image(1:84, 1:84, x, col=col, xaxt='n', yaxt='n', xlab='', ylab='')
# set up the axis
> axis(3, i, labels=names(l), las=2, tick=T)
> axis(2, i, labels=names(l), las=2, tick=T)
> grid(84, col='black', lty='solid')
# this is where i get the lables from
> l
    NEW:4:0   NEW:4:100   NEW:4:250   NEW:4:500  NEW:4:1000
NEW:24:0
          3           3           3           3           3
3
 NEW:24:100  NEW:24:250  NEW:24:500 NEW:24:1000     OLD:4:0
OLD:4:100
          3           3           3           3           4
3
  OLD:4:250   OLD:4:500  OLD:4:1000    OLD:24:0  OLD:24:100
OLD:24:250
          2           3           3           4           3
2
 OLD:24:500 OLD:24:1000     PRG:4:0   PRG:4:100   PRG:4:250
PRG:4:1000
          3           3           3           3           3
3
   PRG:24:0  PRG:24:100  PRG:24:250 PRG:24:1000
          3           3           3           3
# these are the positions along the axis for the tick marks, technical
# replicates from 1 to 3 (replicates of one factor level combination),
4 to 6
# ...
> i
 [1]  3  6  9 12 15 18 21 24 27 30 34 37 39 42 45 49 52 54 57 60 63 66
69 72 75
[26] 78 81 84
                    
                
                