Extract plotting code
Port slides to Sweave