| 2790 | |
| 2791 | @image_comparison(['test_stairs_options.png'], style='mpl20', remove_text=True) |
| 2792 | def test_stairs_options(): |
| 2793 | x, y = np.array([1, 2, 3, 4, 5]), np.array([1, 2, 3, 4]).astype(float) |
| 2794 | yn = y.copy() |
| 2795 | yn[1] = np.nan |
| 2796 | |
| 2797 | fig, ax = plt.subplots() |
| 2798 | ax.stairs(y*3, x, color='green', fill=True, label="A") |
| 2799 | ax.stairs(y, x*3-3, color='red', fill=True, |
| 2800 | orientation='horizontal', label="B") |
| 2801 | ax.stairs(yn, x, color='orange', ls='--', lw=2, label="C") |
| 2802 | ax.stairs(yn/3, x*3-2, ls='--', lw=2, baseline=0.5, |
| 2803 | orientation='horizontal', label="D") |
| 2804 | ax.stairs(y[::-1]*3+13, x-1, color='red', ls='--', lw=2, baseline=None, |
| 2805 | label="E") |
| 2806 | ax.stairs(y[::-1]*3+14, x, baseline=26, |
| 2807 | color='purple', ls='--', lw=2, label="F") |
| 2808 | ax.stairs(yn[::-1]*3+15, x+1, baseline=np.linspace(27, 25, len(y)), |
| 2809 | color='blue', ls='--', label="G", fill=True) |
| 2810 | ax.stairs(y[:-1][::-1]*2+11, x[:-1]+0.5, color='black', ls='--', lw=2, |
| 2811 | baseline=12, hatch='//', label="H") |
| 2812 | ax.legend(loc=0) |
| 2813 | |
| 2814 | |
| 2815 | @image_comparison(['test_stairs_datetime.png'], style='mpl20') |