Improved chart plot, which now outputs a PDF.