New code for plotting light curves with errors