8000 Replace usage of Lena image in the gallery. · matplotlib/matplotlib@25aba29 · GitHub
[go: up one dir, main page]

Skip to content

Commit 25aba29

Browse files
committed
Replace usage of Lena image in the gallery.
Note that lena.npy was created in PR #1924 before I realized matplotlib could read png images without PIL. That file wasn't used anywhere else, so I remove it here.
1 parent 96ecc79 commit 25aba29

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

examples/images_contours_and_fields/image_demo.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
"""
22
Simple demo of the imshow function.
33
"""
4-
import numpy as np
54
import matplotlib.pyplot as plt
65
import matplotlib.cbook as cbook
76

8-
image_file = cbook.get_sample_data('lena.npy')
9-
image = np.load(image_file)
7+
image_file = cbook.get_sample_data('ada.png')
8+
image = plt.imread(image_file)
109

1110
plt.imshow(image)
1211
plt.axis('off') # clear x- and y-axes

examples/images_contours_and_fields/image_demo_clip_path.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
"""
22
Demo of image that's been clipped by a circular patch.
33
"""
4-
import numpy as np
54
import matplotlib.pyplot as plt
65
import matplotlib.patches as patches
76
import matplotlib.cbook as cbook
87

98

10-
image_file = cbook.get_sample_data('lena.npy')
11-
image = np.load(image_file)
9+
image_file = cbook.get_sample_data('grace_hopper.png')
10+
image = plt.imread(image_file)
1211

1312
fig, ax = plt.subplots()
1413
im = ax.imshow(image)
15-
patch = patches.Circle((130, 130), radius=100, transform=ax.transData)
14+
patch = patches.Circle((260, 200), radius=200, transform=ax.transData)
1615
im.set_clip_path(patch)
1716

1817
plt.axis('off')
-192 KB
Binary file not shown.

0 commit comments

Comments
 (0)
0