The following is a relevant example. I'm looking at shot efficiency as a function of distance for NBA players. I want to weight the smoothing by the volume of shots taken at each distance (i.e. the size of the bubbles). Is there a way to do this? The command to generate this plot was:
ggplot(top10,aes(x=FT,y=PPS,size=FGA,color=PPS))
+scale_x_continuous(limits = c(0, 30))
+scale_y_continuous(limits = c(0, 2.2))+geom_point()
+facet_grid(NAME~.,space="free")
+stat_smooth(color="darkblue",size=2)
As Ben noted above, if you change the first line to
ggplot(top10,aes(x=FT,y=PPS,size=FGA,color=PPS,weight=FGA))
it works.
Here's a corrected version:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With