| 144 | |
| 145 | @mpl.style.context("default") |
| 146 | def test_bar(self): |
| 147 | mpl.rcParams["date.converter"] = "concise" |
| 148 | |
| 149 | fig, (ax1, ax2) = plt.subplots(2, 1, layout="constrained") |
| 150 | |
| 151 | x_dates = np.array( |
| 152 | [ |
| 153 | datetime.datetime(2020, 6, 30), |
| 154 | datetime.datetime(2020, 7, 22), |
| 155 | datetime.datetime(2020, 8, 3), |
| 156 | datetime.datetime(2020, 9, 14), |
| 157 | ], |
| 158 | dtype=np.datetime64, |
| 159 | ) |
| 160 | x_ranges = [8800, 2600, 8500, 7400] |
| 161 | |
| 162 | x = np.datetime64(datetime.datetime(2020, 6, 1)) |
| 163 | ax1.bar(x_dates, x_ranges, width=np.timedelta64(4, "D")) |
| 164 | ax2.bar(np.arange(4), x_dates - x, bottom=x) |
| 165 | |
| 166 | @mpl.style.context("default") |
| 167 | def test_bar_label(self): |