-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
plt.step(..., where="auto") #5855
Copy link
Copy link
Closed
Labels
Difficulty: Mediumhttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issueshttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issuesNew feature
Milestone
Description
Metadata
Metadata
Assignees
Labels
Difficulty: Mediumhttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issueshttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issuesNew feature
Type
Fields
Give feedbackNo fields configured for issues without a type.
I would like to suggest adding a fourth option for the
wherekwarg ofplt.step:where="auto". This would takexandyarguments which differ by 1 (in either way) in length, and make a step plot that either has horizontal segments at both ends (iflen(x) == len(y) + 1) or has vertical segments at both ends (iflen(y) == len(x) + 1).As far as I know, currently, to make such a plot one must manually duplicate either the first or the last value in the shorter of the two arrays, which is a bit awkward. Additionally,
"auto"-mode would make it much easier to rotate such a plot by 90° (in the "vertical" direction): you'd just have to switch thexandyarguments, without worrying about whether you need to changewhereor which element to duplicate.Thoughts?