Reputation: 1
I am trying to create a contour plot in R in which all points in a certain contour are scaled according to the density inside that contour, not with respect to the density of all points in total. For example, I am trying to replicate a plot like this: https://docs.flowjo.com/flowjo/graphs-and-gating/data-visualization-and-display/gw-zebra/.
I am not sure where to proceed in doing so. If anyone could provide any advice, that would be greatly appreciated.
Upvotes: 0
Views: 139
Reputation: 8811
Myabe this will hel you
library(tidyverse)
df <-
tibble(
x = rnorm(1000),
y = rnorm(1000)
)
df %>%
ggplot(aes(x, y))+
geom_density_2d_filled()
Upvotes: 0