"experiment: spectrophotometric determination of the acid dissociation constant of methyl red"

1. Why is pH plotted against log([MR-]/[HMR]) to get the pKa of methyl red?
2. Why is it right that HMR has a pH equal to 2 and MR- to have a pH equal to 8?