Added a function to plot err vs. threshold.