function for point plotting