finalize plots code supplement