Beyond the Box Score: An SB Nation Community

Navigation: Jump to content areas:


Sports blogs for fans, by fans.
Around SBN: Fedor vs Rogers Results and Live Coverage

Graphing 201: PITCHf/x Flight Paths

At this point, I'm going to assume you know how to grab data and deal with charts and formulas in Excel, at least at a basic level. Check out the earlier tutorial threads (all linked from here) as there are lots of goodies in the comments.

Once you've completed the Graphing 101 series, you'll be cooking with gas. Or gassed. Or gassy. YMMV. 

Flight Paths

Cill02_medium

You'll need two things to do create your own flight path graphs. First, grab the template file (Excel; revised version - see notes and comments below). Second, grab some data.

The numbers you need for a flight path are the nine basic fields of PITCHf/x, the numbers that the whole path is built from. There are three components -- initial location, initial velocity, and (initial) acceleration -- each with x, y, and z coordinates. PITCHf/x provides the initial values, and physics equations provide the trajectory.

Initial location is better known as release point, which is actually a bit of a misnomer. Gameday sets the release point at 50 feet along the mound-plate axis, but the other eight values will vary from pitch to pitch.

By the way, that 50 foot measurement is from the back of home plate. The front of home plate is actually 1.417 feet closer, which is a very important piece of information, already reflected in the template. Also, I move the release points back to 55 feet, mor in line with where a pitcher actually releases the ball and recalculate the rest of the location and velocity components. PITCHf/x assumes the acceleration is constant, which is a pretty good assumption, and is why we're dealing with parabolic, second-degree equations.

 

Star-divide

The data columns you need to grab are  x0 y0 z0 vx0 vy0 vz0 ax ay az

Note: the order of the fields in the spreadsheet are not as described - see the first comment below, and I'm updating the file a revised version has been posted [Dan, let me know if that's right now].

I almost always aggregate pitches, and flight the "typical" path. Using the data straight from Gameday means you're grabbing each pitch separately. Since you've probably just imported a whole pitcher's game into Excel, just use the built in Excel function to average out the values by pitch type, using the Gameday classification or your own. Whatever you want. One fun thing to do is to chart a high fastball and an average curve or change-up.

Once you have the data you want, you'll need to insert the nine values into the template file.

  • The values go in the order listed above and start, for each pitch, in column F and end in column N.
  • I include a variety of optional fields elsewhere, but those are the ones you need.
  • Once you've pasted in the values for a pitch, the time line will automatically update. And so will the charts.

Tweaking the Charts

The two charts are built from the time line data. Since the time line is nothing but a bunch of formulas, you don't need to touch them (see below on adding more pitches, and time lines). But the charts you'll probably want to work with and improve.

Changing the colors and shapes is something Clippy can help you with, so I'll just point out the labels are built from columns A through C. You can easily adjust that to a single column or whatever by editing the source data (right-click on the chart and pick the appropriate option). For help with the resulting dialog box, again, I'll suggest Clippy.

Adding More Pitches

The template provides room for three, but you can add more. Be careful, since some graphs end up harder to read at four pitches, and five and above can be tough on the eyes.

As is, the template has room for nine pitches, but you can insert rows to your heart's content. As if nine isn't enough.

The trick is adding to the time line. There are some notes in the template file, and I'll expand on those here.

  1. Select and copy A24:A26 and paste in A28:A30. The way the formulas are set-up, you'll need to manually correct the cell references in the new entries you've created in A28:A30.
  2. Double click A28. You'll notice a box will surround the cells that are referenced in the formula.
  3. You'll need to move three boxes. F8 to F5, I8 to I5 and L8 to L5. You can do that by dragging the little boxes or by editing the formula in the cell itself. (corrected cell references from row  to row )
  4. You'll then need to do the same thing for A29 and A30, the columns shift to the right one spot each, so you'll be working with G,J,M and H,K,N instead of F,I,L as shown in step 3.
  5. Select A28:Y30 and fill right. That will copy the adjusted formula to the end of the time line.

Repeat the process for each additional pitch, just shift on down the ladder each time. And feel free to record yourself a Macro, create different sized templates etc. to make your life easier in the long run.

Now you need to add the pitches to the charts.

  1. Right click one of the charts and choose "Source Data"
  2. Select the "Series" tab
  3. Take note of the cell ranges for the other pitches
  4. Click the "add" button
  5. For both views, the x axis of the chart uses the "y" locations from the time line (starting at 50, or 55 if you adjusted y0, Mr. Math) and are the middle row in the time line for each pitch
  6. For the first base view, the y axis of the chart refers to the "z" or height locations of the pitch.  Those are found in the bottom row of the time line for each pitch
  7. For the bird's eye view, the y axis of the chart refers to the "x" or horizontal locations of the pitch.  Those are found in the top row of the time line for each pitch

Making a Web Friendly Graphic

There are a lot of ways to do this, here's one. Once you've got your pitches and your lines and bubbles and labels ready to go, open your favorite graphics editor. Paint will do.

Start with the first base view chart. You'll need to select the entire chart, so just click anywhere in the white area above the flight path. Copy and paste that into whatever you're using to make the image. Now, go and do the same thing with the bird's eye, and paste it into the same image file.

If you're just using Paint and being crude with it (which is a good description of my technique), you'll seemingly cover the first base view with the bird's eye. Without de-selecting the pasted region, just drag it up the screen until you have both panes visible, bird's eye above first base.

 

Questions? (Besides the catcher's view, that's another post altogether.)  Leave 'em in the comments. As time allows and need arises, we'll probably add some screenshots. Feel free to leave your own in the comments.  And share your work!  Creative uses and improvements for the chart would be great to see (steal).  Let's make it an open source effort.

3 recs  |  Comment 20 comments |

Story-email Email Printer Print

More from Beyond the Box Score

Speed Check - AFL vs. MLB

Nov 2009 by Harry Pavlidis - 4 comments

Comments

Display:

woooo flight paths

First, I should note that the template order is actually x0 y0 z0 ax ay az vx0 vy0 vz0. Which means, at least initially, you can’t just do straight average/copy-paste, or else you’ll get some really funky paths (which is how I noticed). You have to swap the “a” set and “v” set from their Gameday order. At least, that’s how it went for me.

But who cares? Look ma, flight paths!

Awesome. Thanks for this, Harry.

Marlins Stadium: When It's Raining, The Roof Will Happen!

by dan 2.0 on Jun 3, 2009 10:54 AM EDT reply actions   0 recs

Thanks for pointing out the ordering issue

I’ll update the template so it matches gameday’s and re-post it.

by Harry Pavlidis on Jun 3, 2009 11:20 AM EDT up reply actions   0 recs

Release points

I often find it interesting when release points don’t match up between pitches. But it would also be nice to have all the pitches start at the same point to more easily compare movement. Is there an easy way to do that?

On a similar note, different pitches are often aimed at different locations, and that’s interesting to now. But it would be helpful, too, to change things so the initial left to right trajectory is the same for all pitches. That, too, seems lie it’s an easy fix. Maybe.

Beyond the Boxscore // Calling BJ Upton lazy is lazy.

by Sky Kalkman on Jun 3, 2009 11:48 AM EDT reply actions   0 recs

You could

It’s better to adjust back to 55 ft, and then you get less difference. And the movement is impacted by the arm slot (change tail to sink, for example). The release point adjusted spin charts (see Brooks for the best examples, in polar format) do a good job of getting down to spin vs. release effects

by Harry Pavlidis on Jun 3, 2009 1:17 PM EDT up reply actions   0 recs

Step 3 for adding another pitch

Doesn’t it need to be F5, I5 and L5? With the headers, a fourth pitch is in the fifth row

The artist formerly known as "mlbnotebook".
MLB Notebook.com
Inside the Majors

by Zach Sanders on Jun 3, 2009 2:46 PM EDT reply actions   0 recs

Harry, I cannot thank you enough. Ever since I’ve seen the flight path charts I’ve constantly said: “Gahhh. I want to do that!” This might be my favorite thing posted on BtB ever, seriously. Thanks.

by Mike Rogers on Jun 3, 2009 6:45 PM EDT reply actions   0 recs

For those who want to show off...

I’d like larger font sizes, more engaging colors, and perhaps some graphics to make the points of view obvious.

Beyond the Boxscore // Calling BJ Upton lazy is lazy.

by Sky Kalkman on Jun 3, 2009 11:17 PM EDT reply actions   0 recs

Nicccce

St. Louis Cardinals... defying win expectancy since 2008

by vivaelpujols on Jun 4, 2009 1:36 AM EDT up reply actions   0 recs

Nice colors and text

How about a plate and pitcher’s mound/rubber outline on the first graph? And pitcher/hitter shadows on the second one?

Beyond the Boxscore // Calling BJ Upton lazy is lazy.

by Sky Kalkman on Jun 4, 2009 7:47 AM EDT up reply actions   0 recs

I'll defer to Harry on this, but this is my thoughts:

Birds Eye: I’m not sure if it’s all that easy, due to the release point. Where is the plate supposed to be positioned? It is a movement graph, not a control graph, so I’m not sure if it’s even appropriate.

As for the 1st Base, that is much more work then it’s worth, I think. Mainly finding the right images would be a pain, because they need to be able to be cut out of the picture to make it look right.

If anyone else wants to expend all that effort, feel free, but I’m happy with the way they’ve turned out.

by Zach Sanders on Jun 4, 2009 7:42 PM EDT up reply actions   0 recs

smack dab in the middle

The graph scale is 8 ft “wide”, so the plate can be centered. It really does show you the average plate crossing, not just the movement. And it’s 8 ft. at both ends, so the rubber/mound can be set accordingly. Remember, it matters where you measure the release point from, 50 or 55. The front of home plate is 1.417 ft on the y axis, so going back 60’6" means the rubber is at 62.017 ft.

To show the x-axis, right click the chart, select chart options. From there, go to the axis tab and check the x-axis box. I strongly recommend leaving the “autoscale” options OFF for these charts, btw. But you can adjust the major units so you can have guides that will help adding elements to the graph.

by Harry Pavlidis on Jun 4, 2009 8:40 PM EDT up reply actions   0 recs

Very nice

I’m using it for our GotD, as a matter of fact. Your royalty check is in the mail.

by Harry Pavlidis on Jun 4, 2009 10:44 AM EDT up reply actions   0 recs

Comments For This Post Are Closed


User Tools

We use numbers and stuff.
Community Guidelines
Why be a member?
Start posting on Beyond the Box Score »

Join SB Nation and dive into communities focused on all your favorite teams.

FanPosts

Community blog posts and discussion.

Recommended FanPosts

Small
PZR-based Win Values 2001-2006

Recent FanPosts

Small
The "30 parks on a budget" challenge
Sunflower_small
World Series Simulation, Game #6
Small
JT20 Dynasty League
E52205a2_small
New Look
Sth70021_small
Exploring Hit f/x, Albeit Badly
Redcap_small
Ricky Nolasco: 4 WAR or 1 WAR?
Redcap_small
Apparently I can't do park adjustments
Small
Which tells us more: The last 7 at bats or 7 at bats against this pitcher?
Sleepy_jeff_small
How Efficient and Effective Were the Rockies in 2009?

+ New FanPost All FanPosts >

FanShots

Quick hits of video, photos, quotes, chats, links and lists that you find around the web.

Recent FanShots

The Mistake Lottery
On the Field, the Yankees Are The Team of the Decade. Off It? The Red Sox.
Tigers' all-time WAR leaders
Primer on Runs Created
How to improve basketball
LB Keith Bulluck uses a sabermetric analogy to explain the Titans' quarterback situation.
Alcides Escobar "abandoned his daughter before she was born"
UZR, Scouting, and the Fans
Not-So-Lousy Lineup Optimizer, Playoff Edition: New York Yankees

+ New FanShot All FanShots >

BtB on Twitter

Main Feed: @BtBScore

Tommy B: @tommy_bennett
Sky: @BtB_Sky
Dan: @dturkenk
Harry: @harrypav
Jinaz: @jinazreds
Jack: @jh_moore
Erik: @Erik_Manning
Tommy R: @trancel
Justin: @justinbopp

Subscribe to BtB via Email

Enter your email address:

Delivered by FeedBurner

Most Commented

Limes_125_small
Time To Move On
Nando_small
A Complete and Lenghty List of Baseball-Related Things Miguel Olivo is Good At
Aviles_small
Minnesota: Fielding TargetView Before & After JJ Hardy
770insig_small
Negative Team WAR - 2009 Edition
E52205a2_small
New Look

Managers

Nando_small R.J. Anderson

Limes_125_small Sky Kalkman

E52205a2_small Tommy Bennett

Editors

Face_small Harry Pavlidis

Rawlings_baseball_bigger_small Dan Turkenkopf

770insig_small Jeff Zimmerman (TucsonRoyal)

Aviles_small Justin Bopp

Authors

Banny_small erik

Raysring1_small Tommy Rancel

Jinaz-reds-avatar_small JinAZ

Jmlogo_small Jack Moore

1753738656_110919ebe9_o_small vivaelpujols

1_small Graham

Baseball_small Mike Rogers

Redcap_small SFiercex4

Small Patrick Clark

Walter_album_small Walter Fulbright