code for creating plots and plots in png format