ggspraychart with baseballR

Alyssa Jones

What can a pitchers response hits tell us?

Pitchers can be categorized as “Fly” or “Ground” based on the tendencies of batters responding to their pitches.

Lets look at some examples

The data used here comes from Baseball Savant Statcast, which allows you to select essentially any statistic that could ever be collected from baseball (and more) and download it into a free csv.

Note: Both pitchers are Left-Handed and have pitched a similar amount.

Visual Representation of a “Ground” Pitcher

This is Framber Valdez, a LHP free agent who played for the Astros from 2018-2025.

Visual Representation of a “Fly” Pitcher

This is Jeffrey Springs, a LHP for the Oakland A’s.

Method

These graphs were created using ggspraychart, a function of the package baseballR.

Let’s use our ggplot knowledge for baseball!

Syntax

The general syntax is very similar to other ggplot functions.

However, due to it being a function that has not been updated since 2019, there are a few main differences.

Column names must be placed within quotations, global variables do not.

Defaults

Fill_value: Blue

Density: FALSE

Bins: 15 (Only applies if density = TRUE)

It is important to note that hc_y must be inverted due to the way statcast data interacts with ggspraychart.

How can these graphs help us?

This data belongs to a mystery pitcher who currently plays for the Cubs. Can you guess if he is a fly-ball or ground-ball pitcher?

Another Look

We can use the density parameter to better see the difference between our two example pitchers.

Valdez (Ground)

Springs (Fly)

Fly-Ball or Ground-Ball?

Here is the density plot for our mystery pitcher, how would you categorize him?

Fly-Ball!

Our mystery pitcher is Shota Imanaga, a LHP for the Chicago Cubs. He is a great example of a fly-ball pitcher.

So what?

“Ground-ball” pitchers play a huge part in run reduction, as they reduce the chances for a home run when compared to their “Fly-Ball” pitching peers. They are better for smaller ballparks, where home runs are easier to hit.

However, “Fly-Ball” pitchers increase the chances for pop-ups and fly outs, allowing outs from the air rather than just by strikeouts or ground outs.

Sources

ggspraychart: https://rdrr.io/github/Fackz/baseball/man/ggspraychart.html

Baseball Savant (statcast): https://baseballsavant.mlb.com/statcast_search