Skip to content

Commit

Permalink
Merge pull request #1976 from tonysyu/replace-lena-in-gallery
Browse files Browse the repository at this point in the history
Replace usage of Lena image in the gallery.
  • Loading branch information
mdboom committed May 6, 2013
2 parents b9f2b72 + 25aba29 commit 1d94744
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
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.

0 comments on commit 1d94744

Please sign in to comment.