Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 8563261

Browse filesBrowse files
committed
Fix example for what's new imshow so it isn't crowded or cut off.
1 parent 13ab5fc commit 8563261
Copy full SHA for 8563261

File tree

Expand file treeCollapse file tree

1 file changed

+4
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-2
lines changed

‎doc/users/next_whats_new/imshow_extent_units.rst

Copy file name to clipboardExpand all lines: doc/users/next_whats_new/imshow_extent_units.rst
+4-2Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ can now be expressed with units.
1111
from matplotlib.dates import HourLocator, DateFormatter
1212
from matplotlib.ticker import AutoMinorLocator
1313

14-
fig, ax = plt.subplots()
14+
fig, ax = plt.subplots(figsize=(6, 6))
1515
date_first = np.datetime64('2020-01-01', 'D')
1616
date_last = np.datetime64('2020-01-11', 'D')
1717

@@ -20,7 +20,9 @@ can now be expressed with units.
2020
ax.imshow(arr, origin='lower', extent=[1, 11, date_first, date_last])
2121

2222
ax.yaxis.set_major_formatter(DateFormatter('%d/%m/%y:- %H00hours'))
23-
ax.yaxis.set_major_locator(HourLocator(byhour=[0, 6, 12, 18, 24]))
23+
ax.yaxis.set_major_locator(HourLocator(byhour=[0, 12, 24]))
2424
ax.yaxis.set_minor_locator(AutoMinorLocator())
2525

26+
fig.tight_layout()
27+
2628
plt.show()

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.