Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Eventplot edgecases #7602

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
wants to merge 4 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fix eventplot where zero-length arrays are given for some properties
  • Loading branch information
dstansby committed Dec 10, 2016
commit 2b5ea43f568fa2b50da165242eab6fc1e364c8ab
6 changes: 3 additions & 3 deletions lib/matplotlib/axes/_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1187,9 +1187,9 @@ def eventplot(self, positions, orientation='horizontal', lineoffsets=1,
if len(linelengths) == 0:
linelengths = [None]
if len(linewidths) == 0:
lineoffsets = [None]
if len(linewidths) == 0:
lineoffsets = [None]
linewidths = [None]
if len(linestyles) == 0:
Copy link
Member

Choose a reason for hiding this comment

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

I understand why to do this for symmetry, but this is a odd special case. Why would you pass in an empty list to get the default behavior?

Copy link
Contributor

Choose a reason for hiding this comment

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

I guess one could also ask why one would want to pass an empty list to get the default for any of the earlier parameters... (unless there's a compelling reason, we should get rid of that behavior :-))

linestyles = [None]
if len(colors) == 0:
colors = [None]

Expand Down