Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vertical white lines when plotting heatmap in TIFF

When I plot a matrix with the image function as a TIFF file, I often get vertical or horizontal lines.

My matrix is of 150000 rows x 2000 columns, the lines also appears when plotting matrices of 150000 rows x 100 columns. The results are the same.

Where do the lines come from? Is this some sort of pixelated artifact? I get them almost all the time.

The matrix looks like this:

    V999 V1000 V1001 V1002 V1003 V1004 V1005 V1006 V1007 V1008 V1009 V1010
[1,]    1     4     0     0    15    15    15    15     8     0     1     0
[2,]    0     3    12     5    15    15    15     1    15     4     0     2
[3,]    0     0     0     3     6    15    15    15    15    15     0     3
[4,]    3     6    15    15    15    15    15     0     3    15    15     2
[5,]   15    15    15     0     3    15    15     2     1     5     8    11
[6,]    2     1     5     8    11    15    15    15     0     0     4     3


tiff("test.tiff", width=450, height=1100) 
image(t(mc),  col = col1, main="950-1500"
dev.off()

Any hints/comments will be much appreciated.

enter image description here

like image 845
Benoit B. Avatar asked Oct 11 '12 12:10

Benoit B.


1 Answers

You're seeing an aliasing artifact from the x11() display. You can try dragging the window to make it bigger or smaller and eventually you'll find a window size height and width that is compatible with your desired resolution.

like image 157
kith Avatar answered Nov 17 '22 09:11

kith