diff --git a/doc/api/next_api_changes/removals/18691-AL.rst b/doc/api/next_api_changes/removals/18691-AL.rst new file mode 100644 index 000000000000..5205383f1f1c --- /dev/null +++ b/doc/api/next_api_changes/removals/18691-AL.rst @@ -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``). diff --git a/examples/images_contours_and_fields/image_clip_path.py b/examples/images_contours_and_fields/image_clip_path.py index e8c3d4fe1abd..3123be4138e0 100644 --- a/examples/images_contours_and_fields/image_clip_path.py +++ b/examples/images_contours_and_fields/image_clip_path.py @@ -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() diff --git a/examples/images_contours_and_fields/image_demo.py b/examples/images_contours_and_fields/image_demo.py index 452f1d50dbcf..d24169518ea1 100644 --- a/examples/images_contours_and_fields/image_demo.py +++ b/examples/images_contours_and_fields/image_demo.py @@ -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() @@ -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) @@ -68,7 +67,7 @@ x, y = zip(*markers) ax.plot(x, y, 'o') -ax.set_title('CT density') +ax.set_title('MRI') plt.show() diff --git a/examples/text_labels_and_annotations/demo_annotation_box.py b/examples/text_labels_and_annotations/demo_annotation_box.py index 0bb4179e7c6f..51cf88d07b07 100644 --- a/examples/text_labels_and_annotations/demo_annotation_box.py +++ b/examples/text_labels_and_annotations/demo_annotation_box.py @@ -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 diff --git a/examples/text_labels_and_annotations/demo_text_path.py b/examples/text_labels_and_annotations/demo_text_path.py index fb208718dd86..938bd80f5fd7 100644 --- a/examples/text_labels_and_annotations/demo_text_path.py +++ b/examples/text_labels_and_annotations/demo_text_path.py @@ -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", diff --git a/examples/ticks_and_spines/centered_ticklabels.py b/examples/ticks_and_spines/centered_ticklabels.py index 825a3a2525b9..61431e3ab21c 100644 --- a/examples/ticks_and_spines/centered_ticklabels.py +++ b/examples/ticks_and_spines/centered_ticklabels.py @@ -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 diff --git a/lib/matplotlib/mpl-data/sample_data/None_vs_nearest-pdf.png b/lib/matplotlib/mpl-data/sample_data/None_vs_nearest-pdf.png deleted file mode 100644 index 40af4721f206..000000000000 Binary files a/lib/matplotlib/mpl-data/sample_data/None_vs_nearest-pdf.png and /dev/null differ diff --git a/lib/matplotlib/mpl-data/sample_data/aapl.npz b/lib/matplotlib/mpl-data/sample_data/aapl.npz deleted file mode 100644 index 653d6a3c8c27..000000000000 Binary files a/lib/matplotlib/mpl-data/sample_data/aapl.npz and /dev/null differ diff --git a/lib/matplotlib/mpl-data/sample_data/ada.png b/lib/matplotlib/mpl-data/sample_data/ada.png deleted file mode 100644 index ce826b026a61..000000000000 Binary files a/lib/matplotlib/mpl-data/sample_data/ada.png and /dev/null differ diff --git a/lib/matplotlib/mpl-data/sample_data/ct.raw.gz b/lib/matplotlib/mpl-data/sample_data/ct.raw.gz deleted file mode 100644 index c03530b13faa..000000000000 Binary files a/lib/matplotlib/mpl-data/sample_data/ct.raw.gz and /dev/null differ diff --git a/lib/matplotlib/mpl-data/sample_data/demodata.csv b/lib/matplotlib/mpl-data/sample_data/demodata.csv deleted file mode 100644 index c167c4c73479..000000000000 --- a/lib/matplotlib/mpl-data/sample_data/demodata.csv +++ /dev/null @@ -1,11 +0,0 @@ -clientid,date,weekdays,gains,prices,up -0,2008-04-30,Wed,-0.52458192906686452,7791404.0091921333,False -1,2008-05-01,Thu,0.076191536201738269,3167180.7366340165,True -2,2008-05-02,Fri,-0.86850970062880861,9589766.9613829032,False -3,2008-05-03,Sat,-0.42701083852713395,8949415.1867596991,False -4,2008-05-04,Sun,0.2532553652693274,937163.44375252665,True -5,2008-05-05,Mon,-0.68151636911081892,949579.88022264629,False -6,2008-05-06,Tue,0.0071911579626532168,7268426.906552773,True -7,2008-05-07,Wed,0.67449747200412147,7517014.782897247,True -8,2008-05-08,Thu,-1.1841008656818983,1920959.5423492221,False -9,2008-05-09,Fri,-1.5803692595811152,8456240.6198725495,False diff --git a/lib/matplotlib/mpl-data/sample_data/grace_hopper.png b/lib/matplotlib/mpl-data/sample_data/grace_hopper.png deleted file mode 100644 index 4a63320ab28d..000000000000 Binary files a/lib/matplotlib/mpl-data/sample_data/grace_hopper.png and /dev/null differ