Integrate plotting code.