code added for plotting graph and pca