我希望在R中制作以下类型的图形,它是边际直方图和geom_hex对象的组合。这最初是一个matplotlib seaborn图形。
我无法让它与RColorbrewer通信。有任何想法吗?
目前为止,我已经得到了:
我无法让它与RColorbrewer通信。有任何想法吗?
目前为止,我已经得到了:
require(ggplot2)
require(RColorBrewer)
require(ggExtra)
bl<-data.frame(beta=rnorm(100),lambda=rnorm(100))
p<-ggplot(bl,aes(x=beta,y=lambda))+
stat_bin_hex()+
#scale_fill_gradient(palette = "Greens") Neither of these work
#scale_fill_continuous(palette = "Greens")+
scale_fill_brewer()+
theme_classic()
ggExtra::ggMarginal(p, type = "histogram")
原始代码:
x, y = np.random.multivariate_normal(mean, cov, 1000).T
with sns.axes_style("white"):
https://seaborn.pydata.org/tutorial/distributions.html
sns.jointplot(x=x, y=y, kind="hex", color="greens");
aes
调用内部完成。ggplot2
文档的使用部分提供了一个示例。 - camille