Plotting code update