final code to produce QA plots