diff --git a/examples/text_labels_and_annotations/angle_annotation.py b/examples/text_labels_and_annotations/angle_annotation.py index 8272dd1f3e06..c00689f09cfa 100644 --- a/examples/text_labels_and_annotations/angle_annotation.py +++ b/examples/text_labels_and_annotations/angle_annotation.py @@ -185,7 +185,7 @@ def update_text(self): r = s / 2 if self.textposition == "inside": r = s / np.interp(angle_span, [60, 90, 135, 180], - [3.3, 3.5, 3.8, 4]) + [10, 3.5, 11.4, 4]) self.text.xy = c + r * np.array([np.cos(angle), np.sin(angle)]) if self.textposition == "outside": def R90(a, r, w, h): diff --git a/plot_types/basic/stairs.py b/plot_types/basic/stairs.py new file mode 100644 index 000000000000..d4b3e505ec51 --- /dev/null +++ b/plot_types/basic/stairs.py @@ -0,0 +1,26 @@ +""" +========== +stairs(x, y) +========== + +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() \ No newline at end of file