Adds curve plotting code.