Heatmaps

77 views
Skip to first unread message

hfz.ali....@gmail.com

unread,
Oct 11, 2018, 7:23:02 AM10/11/18
to ggplot2
Hi,
I am trying to plot heatmap with huge data matrix, can someone help me how I can construct heatmap similar to attached image.

Thanks
heatmap.csv
Correlogram fig.JPG

Kavee L

unread,
Dec 13, 2018, 2:54:15 PM12/13/18
to ggplot2
Hi,

How about this (it is not an optimal solution):


df
<- read_csv("heatmap.csv")
df
%>% gather(x,value, -X1) %>%
       mutate
(x = as.integer(x)) %>%
       ggplot
(aes(x=x, y=X1, color= value)) + geom_point()

Best,
Kavee

Rplot03.png


Rplot01.png

David Kahle

unread,
Dec 13, 2018, 3:45:54 PM12/13/18
to Kavee L, ggplot2
Have you tried geom_raster()?

david.

On Dec 13, 2018, at 1:40 PM, Kavee L <xcub...@gmail.com> wrote:

Hi,

How about this (it is not an optimal solution):


df
<- read_csv("heatmap.csv")
df
%>% gather(x,value, -X1) %>%
       mutate
(x = as.integer(x)) %>%
       ggplot
(aes(x=x, y=X1, color= value)) + geom_point()

Best,
Kavee

<Rplot03.png>


<Rplot01.png>





On Thursday, October 11, 2018 at 7:23:02 AM UTC-4, hfz.ali....@gmail.com wrote:
Hi,
I am trying to plot heatmap with huge data matrix, can someone help me how I can construct heatmap similar to attached image.

Thanks

--
--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: https://github.com/hadley/devtools/wiki/Reproducibility
 
To post: email ggp...@googlegroups.com
To unsubscribe: email ggplot2+u...@googlegroups.com
More options: http://groups.google.com/group/ggplot2

---
You received this message because you are subscribed to the Google Groups "ggplot2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ggplot2+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
<Rplot03.png><Rplot01.png>

===================================

David J. Kahle, Ph.D.
Associate Professor
Department of Statistical Science
Baylor University
www.kahle.io

Kavee L

unread,
Dec 13, 2018, 6:32:02 PM12/13/18
to ggplot2
Something like this ?

df <- read_csv("heatmap.csv")
df %>% gather(x,value, -X1) %>% 
       mutate(x = as.integer(x)) %>% 
       ggplot(aes(x=x, y=X1, fill= value)) + geom_raster()
It is more efficient, right?

Thank you for the suggestion. (I'm still a newbie)

Best,
Kavee


On Thursday, December 13, 2018 at 3:45:54 PM UTC-5, David Kahle wrote:
Have you tried geom_raster()?

david.

On Dec 13, 2018, at 1:40 PM, Kavee L <xcub...@gmail.com> wrote:

Hi,

How about this (it is not an optimal solution):


df
<- read_csv("heatmap.csv")
df
%>% gather(x,value, -X1) %>%
       mutate
(x = as.integer(x)) %>%
       ggplot
(aes(x=x, y=X1, color= value)) + geom_point()

Best,
Kavee

<Rplot03.png>


<Rplot01.png>





On Thursday, October 11, 2018 at 7:23:02 AM UTC-4, hfz.ali....@gmail.com wrote:
Hi,
I am trying to plot heatmap with huge data matrix, can someone help me how I can construct heatmap similar to attached image.

Thanks

--
--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: https://github.com/hadley/devtools/wiki/Reproducibility
 

More options: http://groups.google.com/group/ggplot2

---
You received this message because you are subscribed to the Google Groups "ggplot2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ggplot2+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
<Rplot03.png><Rplot01.png>

Marios Barlas

unread,
Dec 13, 2018, 6:34:54 PM12/13/18
to ggplot2, Kavee L
Geom raster is your best option. For such small array it works fine.

In case you need something stronger for larger data simply use a KDE 2D estimate as quick and dirty solution to reduce the data set to information


From: ggp...@googlegroups.com <ggp...@googlegroups.com> on behalf of Kavee L <xcub...@gmail.com>
Sent: Friday, December 14, 2018 12:32:02 AM
To: ggplot2
Subject: Re: Heatmaps
 
To post: email ggp...@googlegroups.com
To unsubscribe: email ggplot2+u...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages