-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
step-between as drawstyle [Alternative approach to #15019] #15065
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
Closed
Changes from all commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
c670099
Add where="between"/"edges" to step and step="between" to fill_between
andrzejnovak f9d9d43
Protect for scalars in fill_between
andrzejnovak 723dcdd
Fix fill_between input handling
andrzejnovak 4e464eb
clean up
andrzejnovak ce9fbe4
Add svg
andrzejnovak 138d14c
Add fill between step test
andrzejnovak 028d618
Fallback to post-step, when x,y equal len
andrzejnovak aab6c1b
Protect "edges" from Nan values
andrzejnovak babca7e
Fix subslicing, add test at edges
andrzejnovak 5f70d07
Switch broadcasting back to np
andrzejnovak 46c2263
Improve example
andrzejnovak 5264dea
Update docs
andrzejnovak 7ed54a6
Clean for speedup
andrzejnovak b0a6244
Pad where True
andrzejnovak bf04d4c
Merge branch 'master' into ModLine2D
andrzejnovak f9634b2
Merge branch 'master' into ModLine2D
andrzejnovak 65f0282
Undo redundant padding
andrzejnovak 9cc16c1
paddding not needed
andrzejnovak 814f180
flake
andrzejnovak ce92ba5
Merge branch 'master' into ModLine2D
andrzejnovak 8b08a8e
flake
andrzejnovak 3b73e4f
Simplify between-step
andrzejnovak 0d9dec7
flake
andrzejnovak ef10ca4
Merge branch 'master' into ModLine2D
andrzejnovak 72598d6
Try to fix docs
andrzejnovak bc3b19b
flake
andrzejnovak dbc3e92
Merge branch 'master' into ModLine2D
andrzejnovak 80c348b
no np.r_
andrzejnovak 023ebe3
whitespace
andrzejnovak 290be4a
Fix typos
andrzejnovak 46791b7
Externalize polycollection prep into cbook
andrzejnovak 1989735
Fix name
andrzejnovak 94799fd
Merge branch 'master' into ModLine2D
andrzejnovak c26aa11
flake
andrzejnovak b4cae0d
private
andrzejnovak 3fd3b43
private
andrzejnovak File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
doc/users/next_whats_new/option_between_for_step_fill_between.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
New drawstyles for steps - "steps-between", "steps-edges" | ||
------------------------------------------------------------------------ | ||
They are asymmetrical such that abs(len(x) - len(y)) == 1. Typically | ||
to enable plotting histograms with step() and fill_between(). | ||
|
||
.. plot:: | ||
|
||
import numpy as np | ||
import matplotlib.pyplot as plt | ||
|
||
x = np.arange(0,7,1) | ||
y = np.array([2,3,4,5,4,3]) | ||
|
||
fig, ax = plt.subplots(constrained_layout=True) | ||
|
||
ax.plot(x, y + 2, drawstyle='steps-between') | ||
ax.plot(x, y, drawstyle='steps-edges') | ||
|
||
plt.show() | ||
|
||
See :doc:`/gallery/lines_bars_and_markers/step_demo` and | ||
:doc:`/gallery/lines_bars_and_markers/filled_step` for examples. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.