-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Stairsplottype #23311
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
Stairsplottype #23311
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,26 @@ | ||||||||||||||
""" | ||||||||||||||
========== | ||||||||||||||
stairs(x, y) | ||||||||||||||
========== | ||||||||||||||
Comment on lines
+2
to
+4
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Docs won't build if formatting is incorrect:
Suggested change
|
||||||||||||||
|
||||||||||||||
See `~matplotlib.axes.Axes.stairs`. | ||||||||||||||
""" | ||||||||||||||
import matplotlib.pyplot as plt | ||||||||||||||
import numpy as np | ||||||||||||||
|
||||||||||||||
plt.style.use('_mpl-gallery') | ||||||||||||||
|
||||||||||||||
# make data | ||||||||||||||
np.random.seed(3) | ||||||||||||||
x = 0.5 + np.arange(8) | ||||||||||||||
y = np.random.uniform(2, 7, len(x)+1) | ||||||||||||||
|
||||||||||||||
# plot | ||||||||||||||
fig, ax = plt.subplots() | ||||||||||||||
|
||||||||||||||
ax.stairs(x, y, orientation='horizontal') | ||||||||||||||
|
||||||||||||||
ax.set(xlim=(0, 8), xticks=np.arange(1, 8), | ||||||||||||||
ylim=(0, 8), yticks=np.arange(1, 8)) | ||||||||||||||
|
||||||||||||||
plt.show() | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We need the extra line for our linting. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unrelated change?