Skip to content

Barbs broken #5803

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

Closed
dopplershift opened this issue Jan 6, 2016 · 4 comments
Closed

Barbs broken #5803

dopplershift opened this issue Jan 6, 2016 · 4 comments
Assignees
Milestone

Comments

@dopplershift
Copy link
Contributor

I guess there were some line (or polygon edge?) changes with the new style. It turns out this broke Barbs. Here are the results running the barb_demo.py example.

Good (1.5.x):
barbs_good

Bad (master):
barbs_bad

It turns out that there are 0 tests for the Barbs code. I'm willing to submit a PR to fix the problem and add some tests (probably just knock off the demo). Since I think I've seen mention of similar issues elsewhere, can someone point me to what exactly needs to be added, maybe some kind of edge/line style or color?

@dopplershift dopplershift self-assigned this Jan 6, 2016
@dopplershift dopplershift added this to the next major release (2.0) milestone Jan 6, 2016
@jenshnielsen
Copy link
Member

I have not looked at the barbs code at all but from the images alone it looks similar to #5757 fixed by #5759. Especially the filled=False part

@tacaswell
Copy link
Member

I have the same suspicion.

@mdboom
Copy link
Member

mdboom commented Jan 6, 2016

Unfortunately, in this case, barbs require both filled and unfilled parts, so filled=False isn't sufficient. I'd recommend just setting a default linewidth for barbs with something like:

diff --git a/lib/matplotlib/quiver.py b/lib/matplotlib/quiver.py
index aef58c9..d7b9012 100644
--- a/lib/matplotlib/quiver.py
+++ b/lib/matplotlib/quiver.py
@@ -922,6 +922,9 @@ class Barbs(mcollections.PolyCollection):
             kw['edgecolors'] = barbcolor
             kw['facecolors'] = flagcolor

+        if 'linewidth' not in kw:
+            kw['linewidth'] = 1
+
         # Parse out the data arrays from the various configurations supported
         x, y, u, v, c = _parse_args(*args)
         self.x = x

@tacaswell
Copy link
Member

This is someplace where that kwarg normalization function I have in #5056 would be nice to use here to make sure we don't clobber 'lw'.

tacaswell added a commit that referenced this issue Jan 26, 2016
Make barbs draw correctly (Fixes #5803)
tacaswell added a commit that referenced this issue Jan 26, 2016
Make barbs draw correctly (Fixes #5803)
Conflicts:
	lib/matplotlib/tests/test_quiver.py
	  white space vs new test
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

No branches or pull requests

4 participants