Perhaps the most important new thing I note is that Pro Football Reference now has play by play data, and ways to display those data as a CSV format. Creating parsers for the data would be work, but that means that advanced stats are now accessible to the average fan.

In Ubuntu 16.04, PDL::Stats is now a standard Ubuntu package and so the standard PDL installation can be used with my scripts. About the only thing you need to use CPAN for, at this point, is installing Sport::Analytics::SimpleRanking.

At work I use a lot of Python these days. I have not had time to rethink all this into Pythonese. But I’m curious, as the curve fitting tools in Python are better/different than those in Perl.

Football diagrams: Although the Perl module Graphics::Magick isn’t a part of CPAN, graphicsmagick and libgraphics-magick-perl are part of the Ubuntu repositories.


My recent explorations with the program Image Magick has left me thinking: since Image Magick is intended to be used in web sites, where people mass produce images (Image Magick can, for example, take a whole folder full of photos and generate thumbnail images), could I use Image Magick to create the outlines of football fields, complete with yardage lines and hash marks? And the answer so far is yes. Dimensions for football fields can be found here, on The question then is translating those measurements into the dimensions of a regular screen size, such as 640 by 480 or 800 by 600. Please note that the American field is always 160 feet wide, so images whose width is divisible by 160 are desirable.

As an example of what can be done, I’ll show this image of a 46 defense versus a pro style offense on a pro style football field. Note that the image is displayed half of full size. Double click on the image to display full size.

46 defense from a 34 base, versus a pro style offense, pro hash marks.

All the diagram components have been placed with a set of three programs. The first generates three fields, one of pro, one of college and one of high school dimensions. The second places the offense on the field. The third handles the annotations of the defense.

A piece of the football field creation batch file.

A html-ised version of the batch file above is available here. Just cut and paste into a batch file on your local computer and correct variables as directed in the header.

So far I’m not using anything sophisticated to make these images, just batch files. I’m using batch because once I clean these up, I want to make them available to the Deuces and Coach Hoovers of this world for free. And to the high school coach who only has a Windows laptop or desktop, a batch file is the appropriate tool for automating something like this.

Remaining issues: are the hash marks given in the links above at the beginning of the distance from the sideline, at the middle of the distance from the sideline, or at the end of the distance from the sideline? I know it’s at most a 2 foot error, but I’d like to know. Likewise, does anyone know the best font for the numbers one might write on a football field? They’re 6 feet fall, 4 feet wide, and placed so the tip of the number is 9 feet deep into the field. Numbers aren’t essential at this point, just an aesthetic trick.

Update: It’s clear that in pro ball, there are vertical as well as horizontal hashmarks, and the horizontal ones are outside the vertical ones.