Fix plot legend bug.