Fix errorbar extension arrows #5586

Merged
merged 2 commits into from Dec 15, 2015

Conversation

Projects
None yet
4 participants
Owner

mdboom commented Nov 30, 2015

The arrows on errorbar extensions are currently "centered" at the tip of the arrow. This means that if the errorbar line width becomes larger it sticks out from underneath the arrow head, looking quite odd.

This adds new triangle markers that are centered at the base on the arrow head rather than the tip and uses those for errorbar extensions.

mdboom added the needs_review label Nov 30, 2015

mdboom added this to the next major release (2.0) milestone Nov 30, 2015

Owner

jenshnielsen commented Nov 30, 2015

pep8 :(

/home/travis/build/matplotlib/matplotlib/lib/matplotlib/lines.py:37:1: E302 expected 2 blank lines, found 1

Member

QuLogic commented Nov 30, 2015

I assume these are unrelated, but the scatter markers don't seem quite so centred and one of the axes in test_axes/errorbar_mixed.png is in the wrong colour.

Owner

mdboom commented Dec 1, 2015

The markers looking slightly off center is due to 37927b2. It makes the markers look more round, but it also no longer centers them around 0. I'll see if there's a better middle ground in a separate PR.

Good point about the update of the color in test_axes/errorbar_mixed.png. The test is explicitly asking for green there -- I'll have to get to the bottom of why that isn't being obeyed.

Owner

mdboom commented Dec 1, 2015

The test is explicitly asking for green there -- I'll have to get to the bottom of why that isn't being obeyed.

I think this was just due to a mistake on my part. It's been corrected here.

Owner

tacaswell commented Dec 2, 2015

Do we want to revert 37927b2 ? It did fix a problem, but seems to have created another one which is just as bad.

Owner

mdboom commented Dec 2, 2015

Do we want to revert 37927b2 ? It did fix a problem, but seems to have created another one which is just as bad.

I'm wondering if it can be addressed by snapping only the end points and not the control points of the Bézier curve. I plan to experiment with that today when I get a chance. If that doesn't yield better results then, yes, maybe reverting is the best option.

EDIT: Actually -- it's already doing what I was planning to try. (git blame == me).

        if (m_snap && agg::is_vertex(code)) {
            *x = floor(*x + 0.5) + m_snap_value;
            *y = floor(*y + 0.5) + m_snap_value;
        }
Owner

mdboom commented Dec 2, 2015

See #5603 for a possible solution to the off-centered marker issue.

Owner

mdboom commented Dec 2, 2015

Let's hold on this one until #5603 is merged.

tacaswell closed this Dec 3, 2015

tacaswell reopened this Dec 3, 2015

@tacaswell tacaswell added needs_review and removed needs_review labels Dec 3, 2015

Owner

tacaswell commented Dec 3, 2015

I kicked to restart on current master, but @mdboom needs to re-regenerate the images anyway.

Owner

mdboom commented Dec 6, 2015

I've redone the baseline images here after #5603. Once Travis passes, I'd say this is good to go.

Owner

jenshnielsen commented Dec 7, 2015

The superscript changes in errorbar_mixed.png are not for the better but I assume they are unrelated?

Owner

mdboom commented Dec 7, 2015

I think that might be fixed in master already. I'll rebase and see what happens locally.

Owner

mdboom commented Dec 8, 2015

I think the new superscript placement is fine -- I realize it's not as high, but with respect to all of the other combinations that sub/super can find themselves in, I think it's the best choice for the DejaVu font -- anything else has negative consequences in other dimensions. See #4873.

mdboom added some commits Nov 25, 2015

@mdboom mdboom Fix errorbar extension arrows 0d47b5b
@mdboom mdboom PEP8
2b34996
Owner

mdboom commented Dec 14, 2015

Rebased to test this in zero-tolerance mode.

@jenshnielsen jenshnielsen added a commit that referenced this pull request Dec 15, 2015

@jenshnielsen jenshnielsen Merge pull request #5586 from mdboom/errorbar-extension-arrows
Fix errorbar extension arrows
957cc90

@jenshnielsen jenshnielsen merged commit 957cc90 into matplotlib:master Dec 15, 2015

3 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.02%) to 68.305%
Details

tacaswell removed the needs_review label Dec 15, 2015

@jenshnielsen jenshnielsen added a commit that referenced this pull request Dec 15, 2015

@jenshnielsen @jenshnielsen jenshnielsen + jenshnielsen Merge pull request #5586 from mdboom/errorbar-extension-arrows
Fix errorbar extension arrows
ebf81db
Owner

jenshnielsen commented Dec 15, 2015

backported as ebf81db

@tacaswell tacaswell added a commit to tacaswell/matplotlib that referenced this pull request Dec 19, 2015

@jenshnielsen @tacaswell jenshnielsen + tacaswell Merge pull request #5586 from mdboom/errorbar-extension-arrows
Fix errorbar extension arrows
4f40a9d
Member

QuLogic commented Oct 16, 2016

Backport to v2.x is actually via 4f40a9d.

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