plt.stairs: fix unit handling for orientation="horizontal"#31666
plt.stairs: fix unit handling for orientation="horizontal"#31666stiglers-eponym wants to merge 1 commit into
Conversation
| else: | ||
| edges, values, baseline = self._process_unit_info( | ||
| [("y", edges), ("x", values), ("x", baseline)], kwargs) |
There was a problem hiding this comment.
Since vertical is the default, should it be the fallback position? Or will this error out if an orientation besides horizontal or vertical is provided?
There was a problem hiding this comment.
I just followed the convention that is used in mpatches.StepPatch (in patches.py) to which orientation is passed. The current behavior is that any value that is not "vertical" will be interpreted like "horizontal".
One can of course change this behavior, but that was not my intention in this PR.
There was a problem hiding this comment.
I hear that that's a separate discussion. I'm also wondering why stairs has to do unit processing if it's being done inside the patch creation code. Is it cause of:
And if so can that information be populated from patch.get_data()?
PR summary
plt.stairs or Axes.stairs calls
self._process_unit_infoas required for e.g. time dimensions on one axis. This PR introduces a distinction between vertical and horizontal orientation to fix the unit processing for orientation="horizontal".Example
AI Disclosure
No AI was used for this PR.
PR checklist