8000 Eventplot edgecases by dstansby · Pull Request #7602 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

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
Prev Previous commit
Next Next commit
Set line properties to defaults instead of None
  • Loading branch information
dstansby committed Dec 10, 2016
commit c739dd56292b589431f2bf20b1ec7dd6a3626a03
6 changes: 3 additions & 3 deletions lib/matplotlib/axes/_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1183,13 +1183,13 @@ def eventplot(self, positions, orientation='horizontal', lineoffsets=1,
linewidths = np.asarray(linewidths)

if len(lineoffsets) == 0:
lineoffsets = [None]
lineoffsets = [0]
if len(linelengths) == 0:
linelengths = [None]
linelengths = [1]
if len(linewidths) == 0:
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]
linestyles = ['solid']
if len(colors) == 0:
colors = [None]

Expand Down
0