Plotting Discrete Outputs/Inputs

Take a look here.