I'm having issues constructing multiple density plots so that the density is calculated relative to ALL the plots instead of relative to individual plots. I am trying to calculate strikes on fighters during the course of a fight. But, the 'Total' strikes column is not visually displaying density as the greatest number of underlying points. The photo below visualizes what I am trying to do and the issue I am having. In the picture, Round 1 looks like the fighter had more strikes to the head than in the Total Round, where he actually has the most strikes to the head. However, you wouldn't know that based on the coloring, which is being calculated based on individual plots and not all the plots grouped together.
Code is below. df35 is the data frame with all the fighter data, including round, fighter, and x- and y-coordinates to plot the strikes.
d <- ggplot(df35, aes(x,y)) +
stat_density_2d(aes(fill = ..density..), geom = "raster", contour = FALSE, bins=50) +
annotation_raster(mma_winner, xmin=250, xmax=525, ymin=150, ymax=450) +
xlim(250,525) + ylim(150,500) +
facet_grid(fighter ~ round) +
theme_classic() +
scale_fill_distiller(palette = 'RdYlBu', limits = c(0,55e-05))
d + geom_point(data = df46, aes(x,y), color = "red", alpha = 1/2, size = 2)
Image with underlying data points here:
Any help is greatly appreciated!!