Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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
27 changes: 27 additions & 0 deletions galleries/plot_types/basic/stairs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
"""
==============
stairs(x, y)
==============

See `~matplotlib.axes.Axes.stairs`.
"""
import matplotlib.pyplot as plt
import numpy as np

plt.style.use('_mpl-gallery')

# make data
x = np.arange(14)
centers = x[:-1] + np.diff(x) / 2
y = -(centers - 4) ** 2 + 8

# plot
fig, ax = plt.subplots()

ax.stairs(y - 1, x, baseline=None, label='stairs()')
plt.plot(centers, y - 1, 'o--', color='grey', alpha=0.3)

ax.set(xlim=(0, 8), xticks=np.arange(1, 8),
ylim=(0, 8), yticks=np.arange(1, 8))

plt.show()
26 changes: 0 additions & 26 deletions galleries/plot_types/basic/step.py

This file was deleted.