I'm trying to create hitter heat maps that are dependent upon the average value of runs a certain hit is worth, plotted based on physical location of coordinates, ex. so that higher values of an area on the map are red, lower values are blue.
I've researched a bit and can't seem to come up with a solution for this.
EX plot locations + value (X is based on center of plate, to the left is negative, right is positive in meters):
For each of these plot points, there is an attached value (i.e some are 0.5, 0.25, 0, -0.5).
Is there a way to plot that buckets these values and averages them out to create a heatmap similar to this: Heat Map
I don't need it to be continuous like that necessarily, I'm fine with bucketing them. I know how to create the plot with the strike zone built in through ggplot and plot each point individually, but I'm struggling to find a way to aggregate based on nearby plot points and transform that into a heat meap.
My first post here, apologies if I am not up to standard with the amount of detail provided, if there's any more relevant info I can include I'm happy to.
Thank you!