8000 Replace usage of Lena image in the gallery. by tonysyu · Pull Request #1976 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Replace usage of Lena image in the gallery. #1976

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

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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
  • Loading branch information
tonysyu committed May 5, 2013
commit 25aba29563ca337ff081d378976e610dd57f585b
5 changes: 2 additions & 3 deletions examples/images_contours_and_fields/image_demo.py
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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