Modify plotting function to do time scaling