8000 FIX: fix passing empty lists to errorbar xerr/yerr by tacaswell · Pull Request #5717 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

FIX: fix passing empty lists to errorbar xerr/yerr #5717

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

Merged
merged 2 commits into from
Dec 28, 2015

Conversation

tacaswell
Copy link
Member

closes #5641

@tacaswell tacaswell added this to the Critical bugfix release (1.5.1) milestone Dec 22, 2015
@mdboom
Copy link
Member
mdboom commented Dec 22, 2015

Looks fine to me as a stopgap until we have a more general solution, once tests pass.

@mdboom
Copy link
Member
mdboom commented Dec 22, 2015

Restarted seemingly unrelated failure.

(len(xerr) == len(x) and not (
iterable(xerr[0]) and len(xerr[0]) > 1))):
# special case for empty lists
if len(xerr) and not (len(xerr) == 1 or
Copy link
Member

Choose a reason for hiding this comment

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

If I'm not mistaken, these two conditions can be combined into if len(xerr) > 1 and not (everything on the next two lines):.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think you are right.

This slightly simplifies the special casing of empty list in the
handling of xerr and yerr in errorbar
@tacaswell
Copy link
Member Author

There is some pathology I don't understand

ax.errorbar(np.ones(5), np.ones(5), xerr=[[1]]*5)  # works
ax.errorbar([1]*5, [1]*5, xerr=[[1]]*5)  # fails

but I think we should let that go for now

efiring added a commit that referenced this pull request Dec 28, 2015
FIX: fix passing empty lists to errorbar xerr/yerr
@efiring efiring merged commit e4d48ae into matplotlib:v1.5.x Dec 28, 2015
@tacaswell tacaswell deleted the fix_errorbar_empty branch December 28, 2015 20:20
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
0