Plot 1
Plot 2
write plot2.png
Plot 3
Extract common code