我想geom_dotplot通过点的形状(而不是文档建议的颜色)来区分两个不同的变量.例如:
library(ggplot2)
set.seed(1)
x = rnorm(20)
y = rnorm(20)
df = data.frame(x,y)
ggplot(data = df) +
geom_dotplot(aes(x = x), fill = "red") +
geom_dotplot(aes(x=y), fill = "blue")
Run Code Online (Sandbox Code Playgroud)
即在下面的例子中区分x和y
我想将所有x设置为点,将y设置为三角形.
这可能吗?谢谢!
我正在使用ggplot并geom_tile形成热图.我希望在细胞之间插入一些微弱的线条.
例如:
我的ggplot geom_tile热图:
library(ggplot2)
library(reshape2)
data("iris")
x = melt(cor(iris[,1:4]))
ggplot(data=x,aes(Var1,Var2,fill=value)) + geom_tile() # No line between the cells
Run Code Online (Sandbox Code Playgroud)
我想要什么(来自R中的d3heatmap包)
library(d3heatmap)
data("iris")
x = cor(iris[,1:4])
d3heatmap(cor(iris[,1:4]),Rowv = F,Colv = F) #There is a faint line between the cells
Run Code Online (Sandbox Code Playgroud)
(抱歉无法发布任何图片)谢谢!