check if file exists before attempting to plot it