【发布时间】:2020-10-08 02:44:05
【问题描述】:
我想在 R 中使用 log10 比例制作密度散点图。我尝试在 R 中使用 ggplot 和 stat_density2d 绘制它。我使用了以下代码:
ggplot(data=vod_agb_df, aes(vod, agb)) +
stat_density2d(aes(fill = ..density..), geom = "tile", contour = FALSE, n = 100) +
scale_fill_distiller(palette = 'YlOrRd', direction = 1) +
scale_x_continuous(breaks=seq(0, 1, 0.25), limits = c(0, 1)) +
scale_y_continuous(breaks=seq(0, 300, 50), limits = c(0, 300)) +
labs(x='L-VOD', y='AGB(Mg/ha)') +
theme_bw()
但结果看起来很奇怪。 the density scatterplot with my code
【问题讨论】:
标签: r ggplot2 scatter-plot