Skip to content

Cleanup sample_data. #18691

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
Oct 9, 2020
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
9 changes: 9 additions & 0 deletions doc/api/next_api_changes/removals/18691-AL.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
sample_data removals
~~~~~~~~~~~~~~~~~~~~
The sample datasets listed below have been removed. Suggested replacements for
demonstration purposes are listed in parentheses.
- ``None_vs_nearest-pdf.png``,
- ``aapl.npz`` (use ``goog.npz``),
- ``ada.png``, ``grace_hopper.png`` (use ``grace_hopper.jpg``),
- ``ct.raw.gz`` (use ``s1045.ima.gz``),
- ``damodata.csv`` (use ``msft.csv``).
2 changes: 1 addition & 1 deletion examples/images_contours_and_fields/image_clip_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import matplotlib.cbook as cbook


with cbook.get_sample_data('grace_hopper.png') as image_file:
with cbook.get_sample_data('grace_hopper.jpg') as image_file:
image = plt.imread(image_file)

fig, ax = plt.subplots()
Expand Down
11 changes: 5 additions & 6 deletions examples/images_contours_and_fields/image_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
# It is also possible to show images of pictures.

# A sample image
with cbook.get_sample_data('ada.png') as image_file:
with cbook.get_sample_data('grace_hopper.jpg') as image_file:
image = plt.imread(image_file)

fig, ax = plt.subplots()
Expand All @@ -53,12 +53,11 @@

# And another image

w, h = 512, 512

with cbook.get_sample_data('ct.raw.gz') as datafile:
# Data are 256x256 16-bit integers.
w, h = 256, 256
with cbook.get_sample_data('s1045.ima.gz') as datafile:
s = datafile.read()
A = np.frombuffer(s, np.uint16).astype(float).reshape((w, h))
A /= A.max()

fig, ax = plt.subplots()
extent = (0, 25, 0, 25)
Expand All @@ -68,7 +67,7 @@
x, y = zip(*markers)
ax.plot(x, y, 'o')

ax.set_title('CT density')
ax.set_title('MRI')

plt.show()

Expand Down
4 changes: 2 additions & 2 deletions examples/text_labels_and_annotations/demo_annotation_box.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@
ax.add_artist(ab)

# Annotate the 2nd position with another image (a Grace Hopper portrait)
with get_sample_data("grace_hopper.png") as file:
arr_img = plt.imread(file, format='png')
with get_sample_data("grace_hopper.jpg") as file:
arr_img = plt.imread(file)

imagebox = OffsetImage(arr_img, zoom=0.2)
imagebox.image.axes = ax
Expand Down
2 changes: 1 addition & 1 deletion examples/text_labels_and_annotations/demo_text_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def draw(self, renderer=None):

# EXAMPLE 1

arr = plt.imread(get_sample_data("grace_hopper.png"))
arr = plt.imread(get_sample_data("grace_hopper.jpg"))

text_path = TextPath((0, 0), "!?", size=150)
p = PathClippedImagePatch(text_path, arr, ec="k",
Expand Down
4 changes: 2 additions & 2 deletions examples/ticks_and_spines/centered_ticklabels.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
import matplotlib.ticker as ticker
import matplotlib.pyplot as plt

# load some financial data; apple's stock price
r = (cbook.get_sample_data('aapl.npz', np_load=True)['price_data']
# load some financial data; Google's stock price
r = (cbook.get_sample_data('goog.npz', np_load=True)['price_data']
.view(np.recarray))
r = r[-250:] # get the last 250 days

Expand Down
Binary file not shown.
Binary file removed lib/matplotlib/mpl-data/sample_data/aapl.npz
Binary file not shown.
Binary file removed lib/matplotlib/mpl-data/sample_data/ada.png
Binary file not shown.
Binary file removed lib/matplotlib/mpl-data/sample_data/ct.raw.gz
Binary file not shown.
11 changes: 0 additions & 11 deletions lib/matplotlib/mpl-data/sample_data/demodata.csv

This file was deleted.

Binary file not shown.