igroffman commited on
Commit
e56daad
·
verified ·
1 Parent(s): b96de6c

Update app.R

Browse files
Files changed (1) hide show
  1. app.R +5 -1
app.R CHANGED
@@ -557,7 +557,11 @@ catcher_create_framing_plots <- function(catcher_data, catcher_name) {
557
  "Fastball"="#FA8072","Four-Seam"="#FA8072","Sinker"="#fdae61","Slider"="#A020F0",
558
  "Sweeper"="magenta","Curveball"="#2c7bb6","ChangeUp"="#90EE90","Splitter"="#90EE32","Cutter"="red"
559
  )
560
- make_plot <- function(data, title, show_legend = FALSE){
 
 
 
 
561
  if (!nrow(data)) return(ggplot2::ggplot() + ggplot2::theme_void() + ggplot2::ggtitle(title))
562
 
563
  gg <- ggplot2::ggplot(data, ggplot2::aes(PlateLocSide, PlateLocHeight)) +
 
557
  "Fastball"="#FA8072","Four-Seam"="#FA8072","Sinker"="#fdae61","Slider"="#A020F0",
558
  "Sweeper"="magenta","Curveball"="#2c7bb6","ChangeUp"="#90EE90","Splitter"="#90EE32","Cutter"="red"
559
  )
560
+
561
+ # Define the strike zone boundaries (matching in_zone calculation)
562
+ zone <- data.frame(xmin = -0.95, xmax = 0.95, ymin = 1.6, ymax = 3.5)
563
+
564
+ make_plot <- function(data, title, show_legend = FALSE){
565
  if (!nrow(data)) return(ggplot2::ggplot() + ggplot2::theme_void() + ggplot2::ggtitle(title))
566
 
567
  gg <- ggplot2::ggplot(data, ggplot2::aes(PlateLocSide, PlateLocHeight)) +