Reduce plot function