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

Skip to content

Commit bd83031

Browse files
committed
Further simplify example.
1 parent e94428b commit bd83031

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

doc/users/next_whats_new/imshow_extent_units.rst

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,13 @@ can now be expressed with units.
88

99
import matplotlib.pyplot as plt
1010
import numpy as np
11-
from matplotlib.dates import DateFormatter
1211

1312
fig, ax = plt.subplots(layout='constrained')
1413
date_first = np.datetime64('2020-01-01', 'D')
1514
date_last = np.datetime64('2020-01-11', 'D')
1615

1716
arr = [[i+j for i in range(10)] for j in range(10)]
1817

19-
ax.imshow(arr, origin='lower', extent=[1, 11, date_first, date_last])
20-
21-
ax.yaxis.set_major_formatter(DateFormatter('%d/%m/%y'))
18+
ax.imshow(arr, origin='lower', extent=[0, 10, date_first, date_last])
2219

2320
plt.show()

0 commit comments

Comments
 (0)