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

Added particle labelling to plot.annotate(). #358

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

hohlraum
Copy link

Particles can be automatically laballed by plot.annotate(). Also includes a style dictionary similar to that for the markers and background image.

@danielballan
Copy link
Member

Nice!

I notice this could be made more flexible by accepting a string argument for label. So, for example, if I wanted to label particles by their mass, I would pass label='mass'. But if you don't feel inspired to add that to this PR, we can consider this enhancement separately in a backward-compatible way.

@@ -392,10 +392,10 @@ def plot_traj3d(*args, **kwargs):
ptraj3d = plot_traj3d

@make_axes
def annotate(centroids, image, circle_size=None, color=None,
def annotate(centroids, image, circle_size=None, label=False, color=None,
Copy link
Member

Choose a reason for hiding this comment

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

please put new kwargs at the end of the list (think of the case where someone is using annotate(cent, img, 5, 'b') this is now silently (as in the code runs) but does something different).

@caspervdw
Copy link
Member

@hohlraum Are you planning to update the PR? It would be nice to have this addition in the next release.

@danielballan
Copy link
Member

@hohlraum Any chance you'll be able to revisit this?

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.

4 participants