Here is a free way to do it that allows you to get the results into Excel or LibreOffice. You can also use it to study other things like what apertures, lenses, ISO speeds and shutter speeds you are using. It also works with RAW files.
1. On Windows, download and install exiftool, GNU coreutils and GNU grep and add them to your executable search path. On OS X, just install exiftool. The packages for each are located here:http://www.sno.phy.queensu.ca/~phil/exiftool/http://gnuwin32.sourceforge.net/packages/coreutils.htmhttp://gnuwin32.sourceforge.net/packages/grep.htm
If you are using Windows and have cygwin installed, you can skip downloading the GNU utilities as you will likely already have them installed.
2. Using the command prompt, change directories to the one above your photo library. Run the following command sequence:exiftool -r path1 path2 pathn | grep "Focal Length" | grep equivalent > focal-lengths.txt
Where path1 path2 path
n are the names of the photo library directories you want to analyze. You can specify one or multiple directories. If you shoot RAW+JPG, you can add "-ext CR2" or "-ext JPG" to the exiftool command above to make exiftool only look at the photo type you want. As long as you run exiftool without destructive parameters, it will open your images read-only. '-r' just tells it to recurse through all subdirectories underneath the starting path or paths. The grep commands are used to only send the focal length information to the focal-lengths.txt file. With some tweaking you could alter this step to study apertures used, etc. To get an idea of what exiftool reports, try running it on a single photo file without the grep commands, and be sure to scroll up as there is a lot of output.
3. After that command finishes, run the following command sequence:cat focal-lengths.txt | cut -d : -f 3- | cut -d " " -f -2 | sort -n | uniq -c > focal-lengths.csv
Note that Windows has its own sort.exe so you may need to specify the full path to the coreutils sort.exe file.
4. Then open focal-lengths.csv in Excel or LibreOffice and use fixed-width delimiters to split the file into two columns.
5. Select column A (which has the counts for each focal length) and move it to the right of column B (the focal lengths). At least in LibreOffice, this is necessary for the graph to plot correctly, otherwise the axes will be flipped.
6. Select both columns and then generate an X-Y scatter graph, and if desired, have it use lines instead of points.
7. Add axis labels as appropriate.