2d density plot for categories
问题 I'm trying to make a 2d density plot where the density is displayed for each category. For example, in the image below, we have a density plot for each day, and all the daily densities are combined into the coloured plots. These types of plots are common in the scientific literature on atmospheric sciences and aerosol pollution studies. So far I've got this ggplot(dat, aes(y = `dN/dlogDp`, x = date)) + stat_density2d(geom="tile", aes(fill = ..density..), contour = FALSE) + scale_fill_gradient