This Mathematica notebook contains code for calculating and plotting the band structures of armchair and zigzag graphene nanoribbons in a magnetic field. The extensive examples section shows how to use the code to reproduce figures from the recent literature. The final section explores the scaling of Landau level energies with the level index.