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

ENH: Add threshold config for quiver plots #4742

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

matthewturk
Copy link
Member

This adds a thresholding option for quiver plots. Not currently supported in cutting plane.

Closes #4737.

@matthewturk
Copy link
Member Author

I just pushed a new version that fixes the logic errors. Originally I wrote it into the contour callback, which has a field value -- but the quiver callback does not. And the logic should be, "if you specify a threshold field, but don't specify either an upper or lower, then what's the point, skip thresholding." I think this is now in there correctly.

@@ -869,6 +897,25 @@ def _transformed_field(field, data):
periodic,
)

if self.threshold_field is not None:
pixT = plot.data.ds.coordinates.pixelize(
Copy link
Contributor

Choose a reason for hiding this comment

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

One more question :) Do you think it's worth catching the case when threshold_field is the same as field_x or field_y to avoid this pixelize call?

self.field_c,
bounds,
(nx, ny),
False, # antialias
Copy link
Member

Choose a reason for hiding this comment

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

why not pass the argument as keyword ?

Copy link
Member Author

Choose a reason for hiding this comment

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

?

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, I see. I dunno, I don't know that I wrote that code. The indent just made it show up in the diff.

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.

Threshold by a different field in quivers
3 participants