Spaces:
Running
Running
Update app.R
Browse files
app.R
CHANGED
|
@@ -1423,7 +1423,7 @@ create_tableau_movement_plot <- function(pitcher_df, pitch_colors) {
|
|
| 1423 |
ggplot(df, aes(x = HorzBreak, y = InducedVertBreak)) +
|
| 1424 |
geom_vline(xintercept = 0, color = "black", linewidth = 0.4) +
|
| 1425 |
geom_hline(yintercept = 0, color = "black", linewidth = 0.4) +
|
| 1426 |
-
geom_point(aes(fill = TaggedPitchType), size = 2.
|
| 1427 |
shape = 21, color = "black", stroke = 0.9) +
|
| 1428 |
scale_fill_manual(values = pitch_colors, drop = FALSE) +
|
| 1429 |
coord_cartesian(xlim = c(-30, 30), ylim = c(-30, 30)) +
|
|
@@ -1464,7 +1464,7 @@ create_tableau_release_plot <- function(pitcher_df, pitch_colors) {
|
|
| 1464 |
annotate("rect", xmin = -0.5, xmax = 0.5, ymin = 0.85, ymax = 1.05,
|
| 1465 |
fill = "white", color = "gray40", linewidth = 0.3) +
|
| 1466 |
geom_vline(xintercept = 0, color = "gray60", linetype = "dashed", linewidth = 0.3) +
|
| 1467 |
-
geom_point(aes(fill = TaggedPitchType), size = 2.
|
| 1468 |
shape = 21, color = "black", stroke = 0.9) +
|
| 1469 |
scale_fill_manual(values = pitch_colors, drop = FALSE) +
|
| 1470 |
coord_cartesian(xlim = c(-4, 4), ylim = c(0, 7)) +
|
|
@@ -1743,7 +1743,7 @@ if (!is.null(logo_grob)) {
|
|
| 1743 |
print(loc_plot, newpage = FALSE)
|
| 1744 |
popViewport()
|
| 1745 |
|
| 1746 |
-
pushViewport(viewport(x = 0.
|
| 1747 |
print(mov_plot, newpage = FALSE)
|
| 1748 |
popViewport()
|
| 1749 |
|
|
@@ -1775,7 +1775,7 @@ if (!is.null(logo_grob)) {
|
|
| 1775 |
x = table_x, y = 0.645, width = table_w, height = 0.15
|
| 1776 |
)
|
| 1777 |
|
| 1778 |
-
|
| 1779 |
draw_tableau_table_fill(
|
| 1780 |
title = "Velo & Movement",
|
| 1781 |
data = velo_data,
|
|
@@ -1784,7 +1784,7 @@ if (!is.null(logo_grob)) {
|
|
| 1784 |
"Avg. IVB"="Avg. IVB", "Avg. HB"="Avg. HB"),
|
| 1785 |
pitch_types = pitch_types,
|
| 1786 |
pitch_colors = tableau_pitch_colors,
|
| 1787 |
-
x = table_x, y = 0.
|
| 1788 |
)
|
| 1789 |
|
| 1790 |
draw_tableau_table_fill(
|
|
|
|
| 1423 |
ggplot(df, aes(x = HorzBreak, y = InducedVertBreak)) +
|
| 1424 |
geom_vline(xintercept = 0, color = "black", linewidth = 0.4) +
|
| 1425 |
geom_hline(yintercept = 0, color = "black", linewidth = 0.4) +
|
| 1426 |
+
geom_point(aes(fill = TaggedPitchType), size = 2.6, alpha = 1,
|
| 1427 |
shape = 21, color = "black", stroke = 0.9) +
|
| 1428 |
scale_fill_manual(values = pitch_colors, drop = FALSE) +
|
| 1429 |
coord_cartesian(xlim = c(-30, 30), ylim = c(-30, 30)) +
|
|
|
|
| 1464 |
annotate("rect", xmin = -0.5, xmax = 0.5, ymin = 0.85, ymax = 1.05,
|
| 1465 |
fill = "white", color = "gray40", linewidth = 0.3) +
|
| 1466 |
geom_vline(xintercept = 0, color = "gray60", linetype = "dashed", linewidth = 0.3) +
|
| 1467 |
+
geom_point(aes(fill = TaggedPitchType), size = 2.6, alpha = 1,
|
| 1468 |
shape = 21, color = "black", stroke = 0.9) +
|
| 1469 |
scale_fill_manual(values = pitch_colors, drop = FALSE) +
|
| 1470 |
coord_cartesian(xlim = c(-4, 4), ylim = c(0, 7)) +
|
|
|
|
| 1743 |
print(loc_plot, newpage = FALSE)
|
| 1744 |
popViewport()
|
| 1745 |
|
| 1746 |
+
pushViewport(viewport(x = 0.228, y = 0.345, width = 0.41, height = 0.28))
|
| 1747 |
print(mov_plot, newpage = FALSE)
|
| 1748 |
popViewport()
|
| 1749 |
|
|
|
|
| 1775 |
x = table_x, y = 0.645, width = table_w, height = 0.15
|
| 1776 |
)
|
| 1777 |
|
| 1778 |
+
|
| 1779 |
draw_tableau_table_fill(
|
| 1780 |
title = "Velo & Movement",
|
| 1781 |
data = velo_data,
|
|
|
|
| 1784 |
"Avg. IVB"="Avg. IVB", "Avg. HB"="Avg. HB"),
|
| 1785 |
pitch_types = pitch_types,
|
| 1786 |
pitch_colors = tableau_pitch_colors,
|
| 1787 |
+
x = table_x, y = 0.485, width = table_w, height = 0.21
|
| 1788 |
)
|
| 1789 |
|
| 1790 |
draw_tableau_table_fill(
|