Update plotting code