adjust legend method