View source: R/do_viz_shots_scatter.R
| do_viz_shots_scatter | R Documentation |
Create a visualization of the left half of the court and annotates both the total and by zone shooting statistics. It can also show the location of each individual shot, with color-coding for makes and misses.
do_viz_shots_scatter(shots_stats, type, draw, size_lab_box = 2.8, size_lab_court = 3,
size_point = 3, language = "English", title_add = "",
pch_two_shot = 4, pch_three_shot = 17,
color_made_shot = "darkblue", color_missed_shot = "red",
point_intens = 0.4)
shots_stats |
Shooting data associated with the filters given to |
type |
Options are 'team' for team statistics, 'player' for player statistics and 'all' for the whole league. |
draw |
Logical. TRUE to add the shots in their coordinates. FALSE to add just the number of mades and attempted field goals. |
size_lab_box |
Size of the text indicating the overall percentages (they are inside a box). |
size_lab_court |
Size of the text indicating the percentages by zone. |
size_point |
Size of the points. |
language |
Language of the titles. Valid options are 'English' and 'Spanish' so far. |
title_add |
Add additional information to the title if some filters have been applied to the input data frame. |
pch_two_shot |
Point shape of the two-point shots. A number between 0 and 25. Default is 4 (cross). |
pch_three_shot |
Point shape of the three-point shots. A number between 0 and 25. Default is 17 (filled triangle point-up). |
color_made_shot |
Color for the made shots. Default is dark blue. |
color_missed_shot |
Color for the missed shots. Default is red. |
point_intens |
Intensity of the point symbols when plotting all the shots ( |
A plot.
The shapes and colors for the shots are only needed when draw=TRUE,
i.e., when the locations of the shots are plotted.
Guillermo Vinue
do_divide_court_zones, do_filter_data,
do_shots_stats
## Not run:
df0 <- do_divide_court_zones(acb_shooting_data_2425)
df1 <- do_filter_data(df0, "2024-2025", "", "", "", "", "")
shots_stats <- do_shots_stats(df1, df0)
do_viz_shots_scatter(shots_stats, "all", FALSE)
do_viz_shots_scatter(shots_stats, "all", TRUE)
df1 <- do_filter_data(df0, "2024-2025", "", "", "", "", "D. Ennis")
shots_stats <- do_shots_stats(df1, df0)
do_viz_shots_scatter(shots_stats, "player", FALSE)
do_viz_shots_scatter(shots_stats, "player", TRUE)
do_viz_shots_scatter(shots_stats, "player", TRUE, language = "Spanish")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.