From 5d82abd0723f2fb83d1a4f9af5c6cebe9577f9e1 Mon Sep 17 00:00:00 2001 From: Siva Prasad Varma Date: Mon, 24 Mar 2014 09:37:59 +0530 Subject: [PATCH] changed io to ax --- doc/examples/applications/plot_morphology.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/examples/applications/plot_morphology.py b/doc/examples/applications/plot_morphology.py index 145f169e..68ecc6d6 100644 --- a/doc/examples/applications/plot_morphology.py +++ b/doc/examples/applications/plot_morphology.py @@ -30,9 +30,9 @@ from skimage.data import data_dir from skimage.util import img_as_ubyte from skimage import io -plt.gray() phantom = img_as_ubyte(io.imread(data_dir+'/phantom.png', as_grey=True)) -io.imshow(phantom) +fig, ax = plt.subplots() +ax.imshow(phantom, cmap=plt.cm.gray) """ .. image:: PLOT2RST.current_figure @@ -43,10 +43,10 @@ Let's also define a convenience function for plotting comparisons: def plot_comparison(original, filtered, filter_name): fig, (ax1, ax2) = plt.subplots(ncols=2, figsize=(8, 4)) - ax1.imshow(original) + ax1.imshow(original, cmap=plt.cm.gray) ax1.set_title('original') ax1.axis('off') - ax2.imshow(filtered) + ax2.imshow(filtered, cmap=plt.cm.gray) ax2.set_title(filter_name) ax2.axis('off')