Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clabel can be called with approximate postions of labels #642

Merged
merged 2 commits into from
Jan 2, 2012

Conversation

leejjoon
Copy link
Contributor

This is to address #613.

With this patch, clabel can take a list of positions and contour labels will be created near those positions.
For example,

plt.figure()
CS = plt.contour(X, Y, Z)
manual_locations = [(-1, -1.4), (-0.62, -0.7), (-2, 0.5), (1.7, 1.2), (2.0, 1.4), (2.4, 1.7)]
plt.clabel(CS, inline=1, fontsize=10, manual=manual_locations)

The positions should be in data coordinate.

rotation,nlc = cs.calc_label_rot_and_inline(
slc, imin, lw, lc if self.inline else [],
self.inline_spacing )
"""
Copy link
Member

Choose a reason for hiding this comment

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

Why is this commented out block still here? Did you forget to delete it?
You could use this construct; master is 2.6 and up now, so if it requires 2.5 and up, it is OK.
I think that using it inside a long argument list like this is bad for readability, though.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was my oversight. I was simply refactoring related code and didn't take a careful look.
I'll fix it and merge it to master.

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