Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace usage of Lena image in the gallery. #1976

Merged
merged 1 commit into from May 6, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 2 additions & 3 deletions examples/images_contours_and_fields/image_demo.py
@@ -1,12 +1,11 @@
"""
Simple demo of the imshow function.
"""
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cbook as cbook

image_file = cbook.get_sample_data('lena.npy')
image = np.load(image_file)
image_file = cbook.get_sample_data('ada.png')
image = plt.imread(image_file)

plt.imshow(image)
plt.axis('off') # clear x- and y-axes
Expand Down
7 changes: 3 additions & 4 deletions examples/images_contours_and_fields/image_demo_clip_path.py
@@ -1,18 +1,17 @@
"""
Demo of image that's been clipped by a circular patch.
"""
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patches as patches
import matplotlib.cbook as cbook


image_file = cbook.get_sample_data('lena.npy')
image = np.load(image_file)
image_file = cbook.get_sample_data('grace_hopper.png')
image = plt.imread(image_file)

fig, ax = plt.subplots()
im = ax.imshow(image)
patch = patches.Circle((130, 130), radius=100, transform=ax.transData)
patch = patches.Circle((260, 200), radius=200, transform=ax.transData)
im.set_clip_path(patch)

plt.axis('off')
Expand Down
Binary file removed lib/matplotlib/mpl-data/sample_data/lena.npy
Binary file not shown.