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 0f3cc9d

Browse filesBrowse files
committed
image_origin: remove interference between axis and tick labels
1 parent 02c09ce commit 0f3cc9d
Copy full SHA for 0f3cc9d

File tree

Expand file treeCollapse file tree

1 file changed

+7
-12
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+7
-12
lines changed

‎examples/pylab_examples/image_origin.py

Copy file name to clipboardExpand all lines: examples/pylab_examples/image_origin.py
+7-12Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,14 @@
77
import matplotlib.pyplot as plt
88
import numpy as np
99

10-
x = np.arange(100.0)
11-
x.shape = (10, 10)
10+
x = np.arange(120)
11+
x.shape = (10, 12)
1212

1313
interp = 'bilinear'
14-
#interp = 'nearest'
15-
lim = -2, 11, -2, 6
16-
plt.subplot(211, facecolor='g')
17-
plt.title('blue should be up')
18-
plt.imshow(x, origin='upper', interpolation=interp)
19-
#plt.axis(lim)
14+
fig, axs = plt.subplots(nrows=2, sharex=True, figsize=(3, 5))
15+
axs[0].set_title('blue should be up')
16+
axs[0].imshow(x, origin='upper', interpolation=interp)
2017

21-
plt.subplot(212, facecolor='y')
22-
plt.title('blue should be down')
23-
plt.imshow(x, origin='lower', interpolation=interp)
24-
#plt.axis(lim)
18+
axs[1].set_title('blue should be down')
19+
axs[1].imshow(x, origin='lower', interpolation=interp)
2520
plt.show()

0 commit comments

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