From c30b74ec47f8bcec8d9d4f9d70bf269dd9eee309 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Tue, 20 Oct 2015 13:56:32 -0400 Subject: [PATCH 1/5] Don't use cursive and fantasy in font demo It just produces a meaningless warning on most systems --- examples/pylab_examples/fonts_demo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/pylab_examples/fonts_demo.py b/examples/pylab_examples/fonts_demo.py index d1f4fe6cb823..153a9fa3d7f2 100644 --- a/examples/pylab_examples/fonts_demo.py +++ b/examples/pylab_examples/fonts_demo.py @@ -13,7 +13,7 @@ alignment = {'horizontalalignment': 'center', 'verticalalignment': 'baseline'} # Show family options -families = ['serif', 'sans-serif', 'cursive', 'fantasy', 'monospace'] +families = ['serif', 'sans-serif', 'monospace'] font1 = font0.copy() font1.set_size('large') From bf008b03626bd4fb1923c51c204a9a95a6534c17 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Tue, 20 Oct 2015 14:19:11 -0400 Subject: [PATCH 2/5] User should install Pillow to get PIL --- examples/pylab_examples/agg_buffer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/pylab_examples/agg_buffer.py b/examples/pylab_examples/agg_buffer.py index 3f1fb1dc7980..ded95ae40004 100755 --- a/examples/pylab_examples/agg_buffer.py +++ b/examples/pylab_examples/agg_buffer.py @@ -13,7 +13,7 @@ try: from PIL import Image except ImportError: - raise SystemExit("PIL must be installed to run this example") + raise SystemExit("pillow must be installed to run this example") plt.plot([1, 2, 3]) From 7edc58338cbed8ce9f8845018bbbc3738b048d6a Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Tue, 20 Oct 2015 14:21:05 -0400 Subject: [PATCH 3/5] PIL -> Pillow in docs and error messages --- lib/matplotlib/image.py | 6 +++--- lib/matplotlib/widgets.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/matplotlib/image.py b/lib/matplotlib/image.py index 272b406083e1..d1eec44ba198 100644 --- a/lib/matplotlib/image.py +++ b/lib/matplotlib/image.py @@ -1304,7 +1304,7 @@ def pilread(fname): im = pilread(fname) if im is None: raise ValueError('Only know how to handle extensions: %s; ' - 'with PIL installed matplotlib can handle ' + 'with pillow installed matplotlib can handle ' 'more images' % list(six.iterkeys(handlers))) return im @@ -1427,8 +1427,8 @@ def thumbnail(infile, thumbfile, scale=0.1, interpolation='bilinear', make a thumbnail of image in *infile* with output filename *thumbfile*. - *infile* the image file -- must be PNG or PIL readable if you - have `PIL `_ installed + *infile* the image file -- must be PNG or pillow-readable if you + have `pillow `_ installed *thumbfile* the thumbnail filename diff --git a/lib/matplotlib/widgets.py b/lib/matplotlib/widgets.py index ab2331e0b0e4..2fa911be7666 100644 --- a/lib/matplotlib/widgets.py +++ b/lib/matplotlib/widgets.py @@ -171,10 +171,10 @@ def __init__(self, ax, label, image=None, label : str The button text. Accepts string. - image : array, mpl image, PIL image + image : array, mpl image, pillow image The image to place in the button, if not *None*. Can be any legal arg to imshow (numpy array, - matplotlib Image instance, or PIL image). + matplotlib Image instance, or pillow image). color : color The color of the button when not activated From bf28ffd1796f12bf12acf5edba9d69e0ee735970 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Tue, 20 Oct 2015 15:56:05 -0400 Subject: [PATCH 4/5] Revert removal of cursive and fantasy --- examples/pylab_examples/fonts_demo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/pylab_examples/fonts_demo.py b/examples/pylab_examples/fonts_demo.py index 153a9fa3d7f2..d1f4fe6cb823 100644 --- a/examples/pylab_examples/fonts_demo.py +++ b/examples/pylab_examples/fonts_demo.py @@ -13,7 +13,7 @@ alignment = {'horizontalalignment': 'center', 'verticalalignment': 'baseline'} # Show family options -families = ['serif', 'sans-serif', 'monospace'] +families = ['serif', 'sans-serif', 'cursive', 'fantasy', 'monospace'] font1 = font0.copy() font1.set_size('large') From 711c5b6406f44571cf4320026e979274f5548702 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Wed, 21 Oct 2015 11:04:51 -0400 Subject: [PATCH 5/5] Capitalize Pillow --- examples/pylab_examples/agg_buffer.py | 2 +- lib/matplotlib/image.py | 6 +++--- lib/matplotlib/widgets.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/pylab_examples/agg_buffer.py b/examples/pylab_examples/agg_buffer.py index ded95ae40004..1293c723cb8c 100755 --- a/examples/pylab_examples/agg_buffer.py +++ b/examples/pylab_examples/agg_buffer.py @@ -13,7 +13,7 @@ try: from PIL import Image except ImportError: - raise SystemExit("pillow must be installed to run this example") + raise SystemExit("Pillow must be installed to run this example") plt.plot([1, 2, 3]) diff --git a/lib/matplotlib/image.py b/lib/matplotlib/image.py index d1eec44ba198..188d991981a6 100644 --- a/lib/matplotlib/image.py +++ b/lib/matplotlib/image.py @@ -1304,7 +1304,7 @@ def pilread(fname): im = pilread(fname) if im is None: raise ValueError('Only know how to handle extensions: %s; ' - 'with pillow installed matplotlib can handle ' + 'with Pillow installed matplotlib can handle ' 'more images' % list(six.iterkeys(handlers))) return im @@ -1427,8 +1427,8 @@ def thumbnail(infile, thumbfile, scale=0.1, interpolation='bilinear', make a thumbnail of image in *infile* with output filename *thumbfile*. - *infile* the image file -- must be PNG or pillow-readable if you - have `pillow `_ installed + *infile* the image file -- must be PNG or Pillow-readable if you + have `Pillow `_ installed *thumbfile* the thumbnail filename diff --git a/lib/matplotlib/widgets.py b/lib/matplotlib/widgets.py index 2fa911be7666..94042a59e3bf 100644 --- a/lib/matplotlib/widgets.py +++ b/lib/matplotlib/widgets.py @@ -171,10 +171,10 @@ def __init__(self, ax, label, image=None, label : str The button text. Accepts string. - image : array, mpl image, pillow image + image : array, mpl image, Pillow Image The image to place in the button, if not *None*. Can be any legal arg to imshow (numpy array, - matplotlib Image instance, or pillow image). + matplotlib Image instance, or Pillow Image). color : color The color of the button when not activated