Beyond the Box Score: An SB Nation Community

Navigation: Jump to content areas:


Pro Quality. Fan Perspective.
Login-facebook
Around SBN: SB Nation MMA Rankings for August 2010

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:

Sabathia_medium

2 recs  |  Comment 66 comments |

Story-email Email Printer Print

More from Beyond the Box Score

Comments

Display:

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?

by KMils on Apr 11, 2009 2:44 PM EDT 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.

by Harry Pavlidis on Apr 11, 2009 2:59 PM EDT reply actions  

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.

by KMils on Apr 11, 2009 3:41 PM EDT up reply actions  

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  

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  

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

by Sam Page on Apr 11, 2009 3:39 PM EDT reply actions  

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.

by KMils on Apr 11, 2009 7:52 PM EDT reply actions  

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?

by KMils on Apr 11, 2009 7:55 PM EDT up reply actions  

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.

by mlbnotebook on Apr 11, 2009 8:19 PM EDT up reply actions  

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?

by KMils on Apr 11, 2009 8:33 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

by cwhitman412 on Apr 11, 2009 10:08 PM EDT reply actions  

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

by cwhitman412 on Apr 11, 2009 10:25 PM EDT reply actions  

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  

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  

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

by cwhitman412 on Apr 12, 2009 11:14 PM EDT reply actions  

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.

by mlbnotebook on Apr 13, 2009 5:41 PM EDT up reply actions  

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

by mlbnotebook on Apr 13, 2009 5:43 PM EDT up reply actions  

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.

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.

by Sky Kalkman on Apr 14, 2009 9:14 AM EDT up reply actions  

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.

by mlbnotebook on Apr 13, 2009 10:44 PM EDT 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 NoNameOnCard on Apr 13, 2009 11:54 PM EDT reply actions  

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.

Connect_with_facebook

FanPosts

Community blog posts and discussion.

Recent FanPosts

Paige_small
Kelly Johnson Cleared Waivers; I Think That's Weird
1281196069_small
Top 10 players to start a franchise with revised.
Ballgame_2006_vs_texas_revised_small
The Myth of the Spoiler Returns
Small
Denard Span's Strikezone
Small
Matusz: Danks 2.0
Paige_small
I Think I Offended Juan Pierre
Leopold_butter_scotch_southpark_small
HOF/PED Quandry
Small
The Power Rank
Leopold_butter_scotch_southpark_small
The Offseason Trade of Prince Fielder
Small
What is the Cy Young Award?

+ New FanPost All FanPosts >

Sign up for the BtB Newsletter!

FanShots

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

Recent FanShots

Plate discipline trends
What's Wrong With Mike Pelfrey?
Lightest Players in History (min 1000 PA or 500 IP)
Statistical Head Scratchers: The Sacrifice Fly
Adam Wainwrights Curve
Jose Batista Facts
A PitchFX look at how R.A. Dickey is able to change speeds with his knuckleball to be so effective
Out Rate: a simple new upgrade on OBP
Tommy Hunter vs. Scott Feldman
Does anybody know of somewhere you can download up to date pitch-by-pitch...

+ New FanShot All FanShots >

BtB on Facebook

BtB on Twitter

RSS Feed: @BtBScore

Sky: @BtB_Sky

Jeff: @jeffwzimmerman
Steve: @steve_sommer
Dan: @dturkenk
Harry: @harrypav
Jinaz: @jinazreds
Jack: @jh_moore
Tommy R: @trancel
Justin: @justinbopp
Satchel: @SatchelPrice
Adam: @baseballtwit
Larry: @wezen_ball
Peter: @CapitolAvenue
Paul: @TheDiaTribe
Daniel: @CamdenCrazies
Matt: @devil_fingers

SBNation.com Recent Stories

Colorado Rockies' Carlos Gonzalez, left, and Ubaldo Jimenez, right, celebrate in the dugout after Gonzalez hits his second home run of the game in the sixth inning of a baseball game against the San Francisco Giants at Coors Field in Denver on Wednesday, Aug. 4, 2010. The Rockies won 6-1. (AP Photo/Chris Schneider)

Five Numbers: Carlos Gonzalez's Home Dominance, Baseball's Wave Of Flamethrowers, And More

Philadelphia Phillies' Chase Utley, right, celebrates his grand slam against the Colorado Rockies with teammates, from left, Ben Francisco, Jimmy Rollins and Brian Schneider in the seventh inning of a baseball game in Denver on Thursday, Sept. 2, 2010. The Phillies won 12-11. (AP Photo/Barry Gutierrez)

Phillies Post Nine-Run Seventh Inning, Hold On In Narrow Defeat Of Rockies

Detroit Tigers' Don Kelly (32) is congratulated in the Tigers' dugout after hitting a solo home run off Minnesota Twins pitcher Scott Baker during the first inning of a baseball game Thursday, Sept. 2, 2010, in Minneapolis. (AP Photo/Tom Olmscheid)

Tigers, Twins Blow Series Of Opportunities, Gerald Laird Wins It In 13th

More from SBNation.com >


Managers

Limes_125_small Sky Kalkman

Wbc_029_small Jeff Sullivan

Editors

Rawlings_baseball_bigger_small Dan Turkenkopf

Dayton_small Jeff Zimmerman (TucsonRoyal)

Aviles_small Justin Bopp

Paige_small Satchel Price

Authors

Jinaz-reds-avatar_small JinAZ

Face_small Harry Pavlidis

Newavatar_small Matt Klaassen

Wezenball-logo_small lar

Big_pun--300x300_small Tommy Rancel

Adam_small adarowski

Redcap_small SFiercex4

St_louis_cardinals_ce1141_003263_small stevesommer05

Small garik16

Julio_teheran_2_small PWHjort

Cclogo_small Daniel Moroz

Closeup4_small J-Doug

Nick_cage_small The DiaTriber