Quantcast

heatmap is producing unwanted horizontal and vertical lines?

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

heatmap is producing unwanted horizontal and vertical lines?

Colin Ford
Hello,

I must start by saying that I am an R novice and am sorry if this is a no-brainer...

I have an csv file that contains a grid of 300x300 data points. Each point represents
a 1Km square on a map. Each point is either a floating point number or NA. I load the
data in with:

  data <- read.csv("matrix.csv", sep=',')

Convert the data to a matrix with:

  data_matrix <- data.matrix(data) 

and then produce the heatmap with:

  data_heatmap <- heatmap(data_matrix,Rowv=NA,Colv='Rowv',margin=c(0,0))

The heatmap is displayed in a separate window as expected and looks correct apart 
from fine white banding lines spaced out evenly over the image running horizontally 
across the image?

At first I thought it was my data but I checked that and its not. If I resize the
image I then see white vertical lines and different horizontal lines appear?

I've tried a number of different settings but can't seem to get rid of these lines.
If I can get rid of them the image will be ideal and just what I want. Does anyone
have any idea of what I'm doing wrong?

Best regards,
Col.
        [[alternative HTML version deleted]]


______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: heatmap is producing unwanted horizontal and vertical lines?

Colin Ford
Hi Pete,

I thought it might be something to do with NA's when I first started but its not. I've attached both the image output and the data. Its almost as if the blocks in the heatmap are not quite meshing together? I've tried heatmap.2 as well and that gave the same result. I also just tried the image command and that was giving the same result as well. 

What I'm wanting are blocks together without the white lines going through but just cant seem to find a way to do that?

Best regards,
Col.


________________________________
From: Peter Morgan <[hidden email]>
To: Colin Ford <[hidden email]>
Sent: Monday, 8 August 2011, 14:37
Subject: Re: [R] heatmap is producing unwanted horizontal and vertical lines?


Hi Col,

Without seeing your data and the heatmap
you are plotting it is hard to tell what is going on. Are the NAs in any
pattern?  NAs appear in heatmap as the background colour which is
white by default since they are plotted transparently (see the image( )
command for details). If this is the case, you could be seeing the pattern
of NAs plotted in white.  

Also, have you tried the the heatmap.2(
) option in gplots?

Regards,

Pete





From:      
 Colin Ford <[hidden email]>
To:      
 "[hidden email]"
<[hidden email]>
Date:      
 08/08/2011 13:05
Subject:    
   [R] heatmap
is producing unwanted horizontal and vertical lines?
Sent by:    
   [hidden email]
________________________________
 


Hello,

I must start by saying that I am an R novice and am sorry if this is a
no-brainer...

I have an csv file that contains a grid of 300x300 data points. Each point
represents
a 1Km square on a map. Each point is either a floating point number or
NA. I load the
data in with:

  data <- read.csv("matrix.csv", sep=',')

Convert the data to a matrix with:

  data_matrix <- data.matrix(data) 

and then produce the heatmap with:

  data_heatmap <- heatmap(data_matrix,Rowv=NA,Colv='Rowv',margin=c(0,0))

The heatmap is displayed in a separate window as expected and
looks correct apart 
from fine white banding lines spaced out evenly over the image running
horizontally 
across the image?

At first I thought it was my data but I checked that and its not. If I
resize the
image I then see white vertical lines and different horizontal
lines appear?

I've tried a number of different settings but can't seem to get
rid of these lines.
If I can get rid of them the image will be ideal and just what I want.
Does anyone
have any idea of what I'm doing wrong?

Best regards,
Col.
               
[[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: heatmap is producing unwanted horizontal and vertical lines?

David Winsemius

On Aug 8, 2011, at 11:53 AM, Colin Ford wrote:

> Hi Pete,
>
> I thought it might be something to do with NA's when I first started  
> but its not. I've attached both the image output and the data.

No, you haven't. Probably was an unacceptable file type.

> Its almost as if the blocks in the heatmap are not quite meshing  
> together? I've tried heatmap.2 as well and that gave the same  
> result. I also just tried the image command and that was giving the  
> same result as well.
>
> What I'm wanting are blocks together without the white lines going  
> through but just cant seem to find a way to do that?

Sounds like the old problem of buggy pdf viewers relating to problems  
with anti-aliasing. Further commentary would probably be available had  
you included any machine or OS specifics,  but why not search in the  
Archives before sending further material?

Search terms likely to be productive: white lines anti-aliasing pdf

(or variations there within)

--
David


>
> Best regards,
> Col.
>
> ________________________________
> From: Peter Morgan <[hidden email]>
> To: Colin Ford <[hidden email]>
> Sent: Monday, 8 August 2011, 14:37
> Subject: Re: [R] heatmap is producing unwanted horizontal and  
> vertical lines?
>
>
> Hi Col,
>
> Without seeing your data and the heatmap
> you are plotting it is hard to tell what is going on. Are the NAs in  
> any
> pattern?  NAs appear in heatmap as the background colour which is
> white by default since they are plotted transparently (see the  
> image( )
> command for details). If this is the case, you could be seeing the  
> pattern
> of NAs plotted in white.
>
> Also, have you tried the the heatmap.2(
> ) option in gplots?
>
> Regards,
>
> Pete
> From:

> Date:
>  08/08/2011 13:05
> Subject:
>    [R] heatmap
> is producing unwanted horizontal and vertical lines?
> Sent by:
>    [hidden email]
> ________________________________
>
> Hello,
>
> I must start by saying that I am an R novice and am sorry if this is a
> no-brainer...
>
> I have an csv file that contains a grid of 300x300 data points. Each  
> point
> represents a 1Km square on a map. Each point is either a floating  
> point number or NA. I load the
> data in with:
>
>   data <- read.csv("matrix.csv", sep=',')
>
> Convert the data to a matrix with:
>
>   data_matrix <- data.matrix(data)
>
> and then produce the heatmap with:
>
>   data_heatmap <-  
> heatmap(data_matrix,Rowv=NA,Colv='Rowv',margin=c(0,0))
>
> The heatmap is displayed in a separate window as expected and
> looks correct apart  from fine white banding lines spaced out evenly  
> over the image running horizontally across the image?
>
> At first I thought it was my data but I checked that and its not. If I
> resize the image I then see white vertical lines and different  
> horizontal
> lines appear?
>
> I've tried a number of different settings but can't seem to get
> rid of these lines.
> If I can get rid of them the image will be ideal and just what I want.
> Does anyone have any idea of what I'm doing wrong?
>
> Best regards,
> Col.

--
David Winsemius, MD
West Hartford, CT

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: heatmap is producing unwanted horizontal and vertical lines?

Michael Sumner-2
In reply to this post by Colin Ford
Is it this?

https://stat.ethz.ch/pipermail/r-devel/2011-July/061540.html

Try a recent version of R 2.13.1 patched

On Tue, Aug 9, 2011 at 1:53 AM, Colin Ford <[hidden email]> wrote:

> Hi Pete,
>
> I thought it might be something to do with NA's when I first started but its not. I've attached both the image output and the data. Its almost as if the blocks in the heatmap are not quite meshing together? I've tried heatmap.2 as well and that gave the same result. I also just tried the image command and that was giving the same result as well.
>
> What I'm wanting are blocks together without the white lines going through but just cant seem to find a way to do that?
>
> Best regards,
> Col.
>
>
> ________________________________
> From: Peter Morgan <[hidden email]>
> To: Colin Ford <[hidden email]>
> Sent: Monday, 8 August 2011, 14:37
> Subject: Re: [R] heatmap is producing unwanted horizontal and vertical lines?
>
>
> Hi Col,
>
> Without seeing your data and the heatmap
> you are plotting it is hard to tell what is going on. Are the NAs in any
> pattern?  NAs appear in heatmap as the background colour which is
> white by default since they are plotted transparently (see the image( )
> command for details). If this is the case, you could be seeing the pattern
> of NAs plotted in white.
>
> Also, have you tried the the heatmap.2(
> ) option in gplots?
>
> Regards,
>
> Pete
>
>
>
>
>
> From:
>  Colin Ford <[hidden email]>
> To:
>  "[hidden email]"
> <[hidden email]>
> Date:
>  08/08/2011 13:05
> Subject:
>    [R] heatmap
> is producing unwanted horizontal and vertical lines?
> Sent by:
>    [hidden email]
> ________________________________
>
>
>
> Hello,
>
> I must start by saying that I am an R novice and am sorry if this is a
> no-brainer...
>
> I have an csv file that contains a grid of 300x300 data points. Each point
> represents
> a 1Km square on a map. Each point is either a floating point number or
> NA. I load the
> data in with:
>
>   data <- read.csv("matrix.csv", sep=',')
>
> Convert the data to a matrix with:
>
>   data_matrix <- data.matrix(data)
>
> and then produce the heatmap with:
>
>   data_heatmap <- heatmap(data_matrix,Rowv=NA,Colv='Rowv',margin=c(0,0))
>
> The heatmap is displayed in a separate window as expected and
> looks correct apart
> from fine white banding lines spaced out evenly over the image running
> horizontally
> across the image?
>
> At first I thought it was my data but I checked that and its not. If I
> resize the
> image I then see white vertical lines and different horizontal
> lines appear?
>
> I've tried a number of different settings but can't seem to get
> rid of these lines.
> If I can get rid of them the image will be ideal and just what I want.
> Does anyone
> have any idea of what I'm doing wrong?
>
> Best regards,
> Col.
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
>



--
Michael Sumner
Institute for Marine and Antarctic Studies, University of Tasmania
Hobart, Australia
e-mail: [hidden email]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: heatmap is producing unwanted horizontal and vertical lines?

Uwe Ligges-3


On 09.08.2011 02:32, Michael Sumner wrote:
> Is it this?
>
> https://stat.ethz.ch/pipermail/r-devel/2011-July/061540.html
>
> Try a recent version of R 2.13.1 patched
>

Where it has been fixed by Duncan Murdoch.

Uwe

> On Tue, Aug 9, 2011 at 1:53 AM, Colin Ford<[hidden email]>  wrote:
>> Hi Pete,
>>
>> I thought it might be something to do with NA's when I first started but its not. I've attached both the image output and the data. Its almost as if the blocks in the heatmap are not quite meshing together? I've tried heatmap.2 as well and that gave the same result. I also just tried the image command and that was giving the same result as well.
>>
>> What I'm wanting are blocks together without the white lines going through but just cant seem to find a way to do that?
>>
>> Best regards,
>> Col.
>>
>>
>> ________________________________
>> From: Peter Morgan<[hidden email]>
>> To: Colin Ford<[hidden email]>
>> Sent: Monday, 8 August 2011, 14:37
>> Subject: Re: [R] heatmap is producing unwanted horizontal and vertical lines?
>>
>>
>> Hi Col,
>>
>> Without seeing your data and the heatmap
>> you are plotting it is hard to tell what is going on. Are the NAs in any
>> pattern?  NAs appear in heatmap as the background colour which is
>> white by default since they are plotted transparently (see the image( )
>> command for details). If this is the case, you could be seeing the pattern
>> of NAs plotted in white.
>>
>> Also, have you tried the the heatmap.2(
>> ) option in gplots?
>>
>> Regards,
>>
>> Pete
>>
>>
>>
>>
>>
>> From:
>>   Colin Ford<[hidden email]>
>> To:
>>   "[hidden email]"
>> <[hidden email]>
>> Date:
>>   08/08/2011 13:05
>> Subject:
>>     [R] heatmap
>> is producing unwanted horizontal and vertical lines?
>> Sent by:
>>     [hidden email]
>> ________________________________
>>
>>
>>
>> Hello,
>>
>> I must start by saying that I am an R novice and am sorry if this is a
>> no-brainer...
>>
>> I have an csv file that contains a grid of 300x300 data points. Each point
>> represents
>> a 1Km square on a map. Each point is either a floating point number or
>> NA. I load the
>> data in with:
>>
>>    data<- read.csv("matrix.csv", sep=',')
>>
>> Convert the data to a matrix with:
>>
>>    data_matrix<- data.matrix(data)
>>
>> and then produce the heatmap with:
>>
>>    data_heatmap<- heatmap(data_matrix,Rowv=NA,Colv='Rowv',margin=c(0,0))
>>
>> The heatmap is displayed in a separate window as expected and
>> looks correct apart
>> from fine white banding lines spaced out evenly over the image running
>> horizontally
>> across the image?
>>
>> At first I thought it was my data but I checked that and its not. If I
>> resize the
>> image I then see white vertical lines and different horizontal
>> lines appear?
>>
>> I've tried a number of different settings but can't seem to get
>> rid of these lines.
>> If I can get rid of them the image will be ideal and just what I want.
>> Does anyone
>> have any idea of what I'm doing wrong?
>>
>> Best regards,
>> Col.
>>
>> [[alternative HTML version deleted]]
>>
>> ______________________________________________
>> [hidden email] mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>> ______________________________________________
>> [hidden email] mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>>
>>
>
>
>

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: heatmap is producing unwanted horizontal and vertical lines?

Colin Ford
In reply to this post by Michael Sumner-2
Yes that sounds very much like it. I'm using R 13.1 on Windows 7 32 bit. I did do a search but didn't find anything - probably not using the correct search terms. Glad its not just me. 

Thank you,
Col.


________________________________
From: Michael Sumner <[hidden email]>

Cc: Peter Morgan <[hidden email]>; "[hidden email]" <[hidden email]>
Sent: Tuesday, 9 August 2011, 1:32
Subject: Re: [R] heatmap is producing unwanted horizontal and vertical lines?

Is it this?

https://stat.ethz.ch/pipermail/r-devel/2011-July/061540.html

Try a recent version of R 2.13.1 patched


> Hi Pete,
>
> I thought it might be something to do with NA's when I first started but its not. I've attached both the image output and the data. Its almost as if the blocks in the heatmap are not quite meshing together? I've tried heatmap.2 as well and that gave the same result. I also just tried the image command and that was giving the same result as well.
>
> What I'm wanting are blocks together without the white lines going through but just cant seem to find a way to do that?
>
> Best regards,
> Col.
>
>
> ________________________________
> From: Peter Morgan <[hidden email]>

> Sent: Monday, 8 August 2011, 14:37
> Subject: Re: [R] heatmap is producing unwanted horizontal and vertical lines?
>
>
> Hi Col,
>
> Without seeing your data and the heatmap
> you are plotting it is hard to tell what is going on. Are the NAs in any
> pattern?  NAs appear in heatmap as the background colour which is
> white by default since they are plotted transparently (see the image( )
> command for details). If this is the case, you could be seeing the pattern
> of NAs plotted in white.
>
> Also, have you tried the the heatmap.2(
> ) option in gplots?
>
> Regards,
>
> Pete
>
>
>
>
>
> From:

> To:
>  "[hidden email]"
> <[hidden email]>
> Date:
>  08/08/2011 13:05
> Subject:
>    [R] heatmap
> is producing unwanted horizontal and vertical lines?
> Sent by:
>    [hidden email]
> ________________________________
>
>
>
> Hello,
>
> I must start by saying that I am an R novice and am sorry if this is a
> no-brainer...
>
> I have an csv file that contains a grid of 300x300 data points. Each point
> represents
> a 1Km square on a map. Each point is either a floating point number or
> NA. I load the
> data in with:
>
>   data <- read.csv("matrix.csv", sep=',')
>
> Convert the data to a matrix with:
>
>   data_matrix <- data.matrix(data)
>
> and then produce the heatmap with:
>
>   data_heatmap <- heatmap(data_matrix,Rowv=NA,Colv='Rowv',margin=c(0,0))
>
> The heatmap is displayed in a separate window as expected and
> looks correct apart
> from fine white banding lines spaced out evenly over the image running
> horizontally
> across the image?
>
> At first I thought it was my data but I checked that and its not. If I
> resize the
> image I then see white vertical lines and different horizontal
> lines appear?
>
> I've tried a number of different settings but can't seem to get
> rid of these lines.
> If I can get rid of them the image will be ideal and just what I want.
> Does anyone
> have any idea of what I'm doing wrong?
>
> Best regards,
> Col.
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
>


--
Michael Sumner
Institute for Marine and Antarctic Studies, University of Tasmania
Hobart, Australia
e-mail: [hidden email]
        [[alternative HTML version deleted]]


______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Loading...