Skip to content

Conversation

@ryanbelt
Copy link
Contributor

Legend: 'outside' locations for legend #3857

For this feature, user are able to just saying legend location without given data point.

     plt.legend(displace=['in','UL'])  #legend inside Upper Left
     plt.legend(displace=['out','BR'])  #legend outside Bottom Right

@tacaswell tacaswell added this to the 2.1 (next point release) milestone Mar 19, 2016
#default displacement inner UpperRight
anchor = "in"
position = in_displace_code["UR"]

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably be done

anchor, code = displace
if anchor.lower() not in set(['in', 'out']):
    raise ValueError(...)
position = code_map[anchor.lower()][code]

@tacaswell
Copy link
Member

Awesome.

Why not integrate this functionality into the existing pos kwarg? This seems to provide two kwargs which can conflict with each other. We have some other APIs like this in the library and they tend to greatly confuse users.

I think displace needs to only set in vs out or this functionality needs to be merged directly into pos.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants