Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/python-2.7/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R 是“中的热图”;“大小点样式”;在ggplot2中可能吗?_R_Ggplot2_Heatmap - Fatal编程技术网

R 是“中的热图”;“大小点样式”;在ggplot2中可能吗?

R 是“中的热图”;“大小点样式”;在ggplot2中可能吗?,r,ggplot2,heatmap,R,Ggplot2,Heatmap,是否可以在ggplot2中用圆圈而不是正方形绘制热图?不仅用颜色渐变来表示值,而且用圆的大小来表示值,这将是很好的。 我想到的是这样一个图,其中圆的大小也由它们的特定值来交替。我已经阅读了ggplot2的热图,但找不到解决方案。对于热图,我将learnr.wordpress.com上发布的示例改为: library(ggplot2) library(plyr) library(reshape2) library(scales) kreuz <- read.csv("http://

是否可以在ggplot2中用圆圈而不是正方形绘制热图?不仅用颜色渐变来表示值,而且用圆的大小来表示值,这将是很好的。 我想到的是这样一个图,其中圆的大小也由它们的特定值来交替。我已经阅读了ggplot2的热图,但找不到解决方案。对于热图,我将learnr.wordpress.com上发布的示例改为:

 library(ggplot2)
 library(plyr)
 library(reshape2)
 library(scales)
 kreuz <- read.csv("http://datasets.flowingdata.com/ppg2008.csv")
 kreuz.m <- melt(kreuz)
 (p <- ggplot(kreuz.m, aes(Name, variable)) +
   geom_tile(aes(fill = value), colour = "white") +
   scale_fill_gradient2(breaks=waiver(), name="binding strength", 
      low ="white", mid= ("lightblue"), high = "steelblue", midpoint = 4))
 base_size <- 10
 p + theme_grey(base_size = base_size) +
   theme(panel.grid.major = element_blank())+
   labs(x = "Patient ID", y = "Phage Motives", title = "Cross Reactivity")+
   scale_x_discrete(expand = c(0, 0)) +
   scale_y_discrete(expand = c(0, 0)) +
   theme(legend.position = "right", axis.ticks = element_blank(), 
      axis.text.x = element_text(size = base_size *0.8, angle = 270, hjust = 0,
      colour = "grey50"))+
   labs(x = "Patient ID", y = "Phagemotives", title = "cross reactivity")
库(ggplot2)
图书馆(plyr)
图书馆(E2)
图书馆(比例尺)

在本例中,大小和颜色都与变量值对应,因为它是kreuz.m数据集中唯一可用的变量数值

ggplot(kreuz.m, aes(Name, variable)) +
  geom_point(aes(size = value, colour=value))