added the edited code for simpleplot2, with the third graph and adjusted legend