extracted function for creating scatter plot; added title