Old plotting code for reference