plots legend as well.