Apparently our Matplotlib (matplotlib-0.99.3) does not have mpl_toolkits.axes_grid1, which is needed for that example. The same example would work in Sage if you used mpl_toolkits.axes_grid, except plt.show() doesn't necessarily work from within Sage, so for instance plt.savefig('test.png') would work to save it in your home directory.