Graphing 101: PitchFx (Movement)
Let's move on in our series, today focusing on pitch movement.
- Assuming you know how to pull data from Gameday, go here and grab you a pitcher's data. If not, go here, find a pitcher, hit "Extended Tabled Data", copy that, and paste special (text) into Excel.
- Now, you have two options, either break the pitches up and have them show as such, or simply go with one icon for all pitches. If you want to break them up, highlight the classification column, go to "data" -- "filter" -- "autofilter" and then "sort descending". The only added hassle is having to select each set of x and y values separately.
- Now, find the column labeled "pfx_x", this is horizontal movement. 0 means straight, -5 means five inches in to right-handed hitters, and 5 means five inches in to left-handed hitters. Make that your x-axis.
- For the x-axis find the "pfx_z" column. This is vertical break compared to a ball with zero spin. Hard fastballs should have pfx_z readings in the double digits, meanwhile curves are usually negative. Set this as your y-axis value.
- Fix your axis so the x-axis has a range of -15 to 15 and a similar range for the y-axis.
- Make it pretty.
Here's the type of stuff you can create using this method, Sabathia 2008 versus 2009:

2 recs |
66 comments
|
Comments
The graph looks mostly right.
I think he’s just go the two words backwards, repeatedly.
by NoNameOnCard on Apr 11, 2009 2:44 PM EDT up reply actions
Can you do a step-by-step...
For getting different pitches to show up as different plots? My data looks similar to yours, but I can’t seem to figure out how to split them up by pitch. "The only added hassle is having to select each set of x and y values separately. " – what do you mean by select each set of x and y separately?
Sort the data by pitch type.
Graph each type as a different series of points.
by NoNameOnCard on Apr 11, 2009 2:46 PM EDT up reply actions
pfx_ is horizontal and other notes
I find using -20/20 as the ranges allows you to standardize your charts for everyone (I started at 15, had to move, stayed there).
Try doing a bubble plot, with MPH or even spin rate as the bubble size (I use MPH in the charts I make for spin movement). The flat or 3D versions both look good in Excel 2003, and I imagine 2007 has some more goodies.
Solid tips.
Standardizing the ranges of your axes allows you to easily compare pitchers to themselves and to anyone else you like.
by NoNameOnCard on Apr 11, 2009 3:08 PM EDT up reply actions
Do you know how to?
Make the bubble size differences much more noticeable? Looking at the Sabathia data from above, his pitch MPH ranges from about 77 to about 95, with most of the pitches between 80 and 94. That’s not that much different in excel.
I've tried
but it was more trouble than it was worth. You have to scale things disproportionately. Where it works, IMO, is as an added little nugget, not the main point. You can usually see the difference between a fastball and a slow curve, and, in the aggregate plots where I label the big dot, the amount of space around the label is an additional visual cue. But it is subtle, unless you do it with spin rates, then you get some noticeable differences.
by Harry Pavlidis on Apr 11, 2009 3:56 PM EDT up reply actions
In some of Harry’s graphs, he generalizes, so to speak, the gobs of data. For instance, instead of having a bunch of dots in the upper right quadrant, he’d just have one large circle labeled “fastball”. Here’s an example from this post.
Anyone know how to do this in Excel, if possible?
by Crashburn Alley on Apr 11, 2009 3:03 PM EDT reply actions
Those are from aggregated data
Once I settle a pitcher’s ids, I run a bunch of reports that generate the data for the plots you refer to, as well as the flight paths, 3D catcher view and other stats/metrics.
I take the scatter plot and make an inset in a graphics editor (MS paint does fine, seriously), nothing fancy.
by Harry Pavlidis on Apr 11, 2009 3:08 PM EDT up reply actions
Oh, and
you can simply do it excel with the formulas there, you don’t need to geek out
by Harry Pavlidis on Apr 11, 2009 3:08 PM EDT up reply actions
How do I grab the data from gameday?
I tried copy and pasting the pitches I wanted to use (I was trying to get the pitches from James McDonald’s horrific thrd inning last night) so I pasted it in the HTML editor but then when I switched back to the WYSIWYG editor all it shows is a dotted line. I’m trying to make a post about it but I guess you can’t simply copy and paste the data?
by Brendan Scolari on Apr 11, 2009 3:20 PM EDT reply actions
you can save the .xml and open in excel or put the URL into an excel web query
by Harry Pavlidis on Apr 11, 2009 3:30 PM EDT up reply actions
Sorry I'm not very good with all of this.
I tried higlighting McDonald’s data during that inning and saving it as a.xml, but when I opened it through excel it was just a blank document. Could you please explain?
by Brendan Scolari on Apr 11, 2009 3:48 PM EDT up reply actions
Try this
In Excel, open a new document, From the Data menu choose get external data → new web query. put this URL in the URL field when prompted
http://gd2.mlb.com/components/game/mlb/year_2009/month_04/day_05/gid_2009_04_05_lanmlb_sfnmlb_1/pbp/pitchers/277405.xml
click the first yellow arrow once
just click OK when prompted for a spot to put the data
voila
by Harry Pavlidis on Apr 11, 2009 3:59 PM EDT up reply actions
Do you think it would be helpful if I created a short video tutorial on how to open up the data in Excel? Some people (myself included) learn better by seeing something done.
by Crashburn Alley on Apr 11, 2009 4:04 PM EDT up reply actions
does anyone know how to do this in openoffice?
"If Bowden was a general contractor, he'd build houses with nine bedrooms, six garages, no bathrooms, and half a roof."
by DyeLongJustice on Apr 11, 2009 6:17 PM EDT up reply actions
tip
If you want to label the each type of pitch, sort by pitch then use “add legend series” for each individual set of pitches.
King of the bling come to lay down the evidence//Not George Bush, L-Millz be da president
Pitch F/X Tutorial: Opening XML Files in Microsoft Excel
It should be here when it’s done being processed on YouTube:
http://www.youtube.com/watch?v=4rj9u1eMbbY
Sorry for any stuttering or any information I may have left out, I made it up on the fly.
I have a slightly different method than the one Harry described above. Neither is better than the other.
by Crashburn Alley on Apr 11, 2009 4:15 PM EDT reply actions 1 recs
Feedback
If you watch this, let me know how it was that way I can improve if I ever do this in the future. Criticism is welcome!
Also let me know if I forgot any steps or if there is other pertinent information I should have included. Thanks! :)
by Crashburn Alley on Apr 11, 2009 6:29 PM EDT up reply actions
Thank you
But when I try to open the XML table through Excel it just opens up a new OpenOffice page. This page only contains what a small yellow box (Like if you were to make a blockquote here and then just leave it blank, only smaller. Does that make sense and what should I do?
I appreciate the help..
by Brendan Scolari on Apr 12, 2009 9:28 AM EDT up reply actions
Sorry
I’ve never used OpenOffice, so I have no idea what to tell you.
by Crashburn Alley on Apr 12, 2009 10:35 AM EDT up reply actions
I don't actually want to use OpenOffice
It just opens when I try to open the table through Excel. Do you know how to remedy this?
by Brendan Scolari on Apr 12, 2009 3:22 PM EDT up reply actions
I see the same thing with OO.
I am trying to find a remedy. I prefer OO because to the price, but this is getting annoying.
by Jeff Zimmerman (TucsonRoyal) on Apr 13, 2009 1:31 PM EDT up reply actions
If you figure out a solution
Could you please let me know? I would really appreciate this a ton. I could give you my email if you want.
by Brendan Scolari on Apr 13, 2009 1:59 PM EDT up reply actions
same here
if u figure it out, please let me know! thanks!
"If Bowden was a general contractor, he'd build houses with nine bedrooms, six garages, no bathrooms, and half a roof."
by DyeLongJustice on Apr 14, 2009 10:17 AM EDT up reply actions
I have the graphs...
Now, how do I actually interpret them? I get the X-axis, but how does the Y-axis work? Does a number greater than zero mean that the pitch has less vertical break (ie straighter?)
And two graphs FYI.
Knuckleballer RA Dickey’s last start.

Three excellent performances by Mariano Rivera. Does Pitch f/x not do so well with cutters? This is 60 pitches – he “only” threw about 9.

Posted too soon
I also want to know what’s up with Dickey? Is his graph merely a reflection of how knuckleballs are so inconsistent regarding location?
And what’s the big deal about Rivera’s fastball/cut fastball? If I’m interpreting this right, it seems to dip faster than other fastballs, with less horizontal movement. Is that amazing?
y axis
0 is the path predicted by gravity’s effect alone – a spinless pitch. More backspin, less drop, more topspin, more drop.
Mo’s cutter moves left A LOT compared to other cutters. Laterally, on the x-axis
by Harry Pavlidis on Apr 11, 2009 8:04 PM EDT up reply actions
Yes, it does
And don’t forget people, Cutter is not so much about total movement, but the late movement that fools the batter.
-Zach Sanders
MLB Notebook.com
Roto Rat.com
I'm assuming
That we’ll get to see how to do the flight paths in this Graphing 101 series. That should clear up the cutter, right?
Cutter and sinker are
next up in shattering myths.
by Harry Pavlidis on Apr 11, 2009 10:15 PM EDT up reply actions
Suggestions
I’ve been doing graphs for Adenhart’s last start. So far I’ve done Xmove/Zmove, Xmove/Speed, Zmove/Speed, and release point. Any suggestions for other graphs?
A noob or n00b is someone that lacks intellegance or common sense, most people think that noob is a word used only in the online gaming world, but in reality it is becoming an ever popular word with teenage society.
a noob could be simply a level 100 running round shouting ‘’WTF DO I GO!?’’ or someone calling someone else a noob and then getting hit with a brick, anyone can call anyone a noob, but normally they are noobs themselves
-robert_d_wilfong
Hmm.
How would you do that using the data?
P.S. I just did a speed over time and a Lefty/Righty movement split.
A noob or n00b is someone that lacks intellegance or common sense, most people think that noob is a word used only in the online gaming world, but in reality it is becoming an ever popular word with teenage society.
a noob could be simply a level 100 running round shouting ‘’WTF DO I GO!?’’ or someone calling someone else a noob and then getting hit with a brick, anyone can call anyone a noob, but normally they are noobs themselves
-robert_d_wilfong
Replied to Harry, Stupid Me.
A noob or n00b is someone that lacks intellegance or common sense, most people think that noob is a word used only in the online gaming world, but in reality it is becoming an ever popular word with teenage society.
a noob could be simply a level 100 running round shouting ‘’WTF DO I GO!?’’ or someone calling someone else a noob and then getting hit with a brick, anyone can call anyone a noob, but normally they are noobs themselves
-robert_d_wilfong
by cwhitman412 on Apr 11, 2009 10:26 PM EDT up reply actions
px and pz scatter plot. draw a "zone" from 1 to -1, 1.5 to 3.5 for reference
by Harry Pavlidis on Apr 11, 2009 11:47 PM EDT up reply actions
The new PITCHf/x data actually has...
the batter’s “real” strike zone height, so you can use the "real’ values instead of 1.5 and 3.5. They are sz_top and sz_bottom. These values will vary from game to game (maybe from AB to AB), since I think they are set visually by an operator.
I’m not sure if these values exist in the older PITCHf/x data sets.
by NoNameOnCard on Apr 12, 2009 10:56 PM EDT up reply actions
I guess this won't really work too much for pitchers...
Maybe you could normalize for it before drawing your zone.
by NoNameOnCard on Apr 12, 2009 10:57 PM EDT up reply actions
sure
if you’re doing it for a batter, but for a pitcher, use the reference box
the sz_top and sz_bot are there, I suggest averaging them for each hitter across all pitches for that hitter and using that value. I recalculate hitters as needed nightly so my strike zones are always as up to date as possible.
by Harry Pavlidis on Apr 12, 2009 11:55 PM EDT up reply actions
Cahill Location

A noob or n00b is someone that lacks intellegance or common sense, most people think that noob is a word used only in the online gaming world, but in reality it is becoming an ever popular word with teenage society.
a noob could be simply a level 100 running round shouting ‘’WTF DO I GO!?’’ or someone calling someone else a noob and then getting hit with a brick, anyone can call anyone a noob, but normally they are noobs themselves
-robert_d_wilfong
How
did you get 2009 PITCHf/x data? Just through gameday?
by Brendan Scolari on Apr 13, 2009 2:09 PM EDT up reply actions
Brooksbaseball.net
I found that site and its very nice. But do you know how to get data for more than just one game? Like, if I want data for Sabathia’s full season instead of just one start is that possible? Also, it doesn’t id the pitches on the charts or what their outcome was like Josh Kalk’s pitchf/x tool. Do you have to wait for that kind of info until after the season?
by Brendan Scolari on Apr 13, 2009 2:40 PM EDT up reply actions
Brooks does detail it.
Select “Pitch Types” under the Change Plots or Apply Splits:heading.
As far as data from more than one game, you have to retrieve it yourself, or get a database up and running.
-Zach Sanders
MLB Notebook.com
Roto Rat.com
You can also choose a bunch of different options on the menu
I don’t remember which one is outcomes, but I know it’s there
-Zach Sanders
MLB Notebook.com
Roto Rat.com
But then they would all be on different graphs right?
There’s no way I can get multiple games on the same graph/table?
by Brendan Scolari on Apr 13, 2009 9:25 PM EDT up reply actions
If you had an entire database, then I would assume you could put all on one graph
Or, you could just download multiple games onto the same spreadsheet, and then color code and such.
-Zach Sanders
MLB Notebook.com
Roto Rat.com
by mlbnotebook on Apr 13, 2009 10:18 PM EDT up reply actions
Hmm
I can’t get the data onto a spreadsheet though. I asked this above but no one was able to help. When I try to get the xml table on excel it opens up openoffice. I don’t know how to get the data any other way. Do you have any ideas?
by Brendan Scolari on Apr 13, 2009 10:22 PM EDT up reply actions
Why not just open up Excel, then up the file from there?
Of am I not getting your question right?
Beyond the Boxscore // Calling BJ Upton lazy is lazy.
Thats what I'm doing.
I open excel and then try to open the file there, but it just makes an openoffice page. Maybe I’m doing it wrong?
by Brendan Scolari on Apr 14, 2009 1:36 PM EDT up reply actions
Ok
I got the data onto excel. I’ve basically never use excel before, so sorry if this is a ridiculous question. But how do I graph it?
by Brendan Scolari on Apr 15, 2009 1:44 AM EDT up reply actions
Highlight the data and click on the chart wizard button.
Googling “excel chart wizard” should return some helpful tips.
Beyond the Boxscore // Calling BJ Upton lazy is lazy.
by Sky Kalkman on Apr 15, 2009 10:36 AM EDT up reply actions
Try this in excel
Granted, this Excel ’03, so the steps could be different
Data → Import External Data → New Web Query
Then I just go to the Brooks page with the data in the table, and import that. The features are a bit different then if you just brought the data in via XML, but it does the job alright.
Another way, if you want to come from straight XML
Data → XML → Import
You need to have the XML saved somewhere, but that is another way to do it.
-Zach Sanders
MLB Notebook.com
Roto Rat.com
Supposed to be a reply to Brendan
-Zach Sanders
MLB Notebook.com
Roto Rat.com
by mlbnotebook on Apr 13, 2009 10:55 PM EDT up reply actions
So
I got the data onto excel. I’ve basically never use excel before, so sorry if this is a ridiculous question. But how do I graph it? I saw about the axis but I have no idea how to even start graphing.
by Brendan Scolari on Apr 15, 2009 1:55 AM EDT up reply actions
I'd suggest writing something like...
a “PITCHf/x 101: Getting the data” post to help people like Brendan get it figured out.
Whether or not you go that way, here’s a link that’s pretty helpful for getting your feet wet: Tracking Pitches Using Video Technology

by 























