From a89dd4deddb4052426fcea706bd0e75fd97218a6 Mon Sep 17 00:00:00 2001 From: Siva Prasad Varma Date: Wed, 19 Mar 2014 17:18:33 +0530 Subject: [PATCH] changed f to fig --- doc/examples/plot_canny.py | 4 ++-- doc/examples/plot_contours.py | 2 +- doc/examples/plot_corner.py | 2 +- doc/examples/plot_daisy.py | 2 +- doc/examples/plot_entropy.py | 4 ++-- doc/examples/plot_equalize.py | 4 ++-- doc/examples/plot_hog.py | 2 +- doc/examples/plot_holes_and_peaks.py | 2 +- doc/examples/plot_ihc_color_separation.py | 2 +- doc/examples/plot_line_hough_transform.py | 4 ++-- doc/examples/plot_local_equalize.py | 4 ++-- doc/examples/plot_local_otsu.py | 6 +++--- doc/examples/plot_medial_transform.py | 4 ++-- doc/examples/plot_otsu.py | 2 +- doc/examples/plot_peak_local_max.py | 4 ++-- doc/examples/plot_phase_unwrap.py | 20 +++++++++---------- doc/examples/plot_piecewise_affine.py | 2 +- doc/examples/plot_pyramid.py | 2 +- doc/examples/plot_radon_transform.py | 8 ++++---- .../plot_random_walker_segmentation.py | 4 ++-- doc/examples/plot_ransac.py | 2 +- doc/examples/plot_regional_maxima.py | 4 ++-- doc/examples/plot_regionprops.py | 2 +- doc/examples/plot_skeleton.py | 4 ++-- doc/examples/plot_ssim.py | 2 +- doc/examples/plot_swirl.py | 2 +- 26 files changed, 50 insertions(+), 50 deletions(-) diff --git a/doc/examples/plot_canny.py b/doc/examples/plot_canny.py index 25b7e6ac..f1caf264 100644 --- a/doc/examples/plot_canny.py +++ b/doc/examples/plot_canny.py @@ -35,7 +35,7 @@ edges1 = filter.canny(im) edges2 = filter.canny(im, sigma=3) # display results -f, (ax1, ax2, ax3) = plt.subplots(nrows=1, ncols=3, figsize=(8, 3)) +fig, (ax1, ax2, ax3) = plt.subplots(nrows=1, ncols=3, figsize=(8, 3)) ax1.imshow(im, cmap=plt.cm.jet) ax1.axis('off') @@ -49,7 +49,7 @@ ax3.imshow(edges2, cmap=plt.cm.gray) ax3.axis('off') ax3.set_title('Canny filter, $\sigma=3$', fontsize=20) -f.subplots_adjust(wspace=0.02, hspace=0.02, top=0.9, +fig.subplots_adjust(wspace=0.02, hspace=0.02, top=0.9, bottom=0.02, left=0.02, right=0.98) plt.show() diff --git a/doc/examples/plot_contours.py b/doc/examples/plot_contours.py index 1be586a9..e686b4ac 100644 --- a/doc/examples/plot_contours.py +++ b/doc/examples/plot_contours.py @@ -29,7 +29,7 @@ r = np.sin(np.exp((np.sin(x)**3 + np.cos(y)**2))) contours = measure.find_contours(r, 0.8) # Display the image and plot all contours found -f, ax = plt.subplots() +fig, ax = plt.subplots() ax.imshow(r, interpolation='nearest', cmap=plt.cm.gray) for n, contour in enumerate(contours): diff --git a/doc/examples/plot_corner.py b/doc/examples/plot_corner.py index 45cc1c75..4e962e17 100644 --- a/doc/examples/plot_corner.py +++ b/doc/examples/plot_corner.py @@ -29,7 +29,7 @@ image[230:280, 60:110] = 1 coords = corner_peaks(corner_harris(image), min_distance=5) coords_subpix = corner_subpix(image, coords, window_size=13) -f, ax = plt.subplots() +fig, ax = plt.subplots() ax.imshow(image, interpolation='nearest', cmap=plt.cm.gray) ax.plot(coords[:, 1], coords[:, 0], '.b', markersize=3) ax.plot(coords_subpix[:, 1], coords_subpix[:, 0], '+r', markersize=15) diff --git a/doc/examples/plot_daisy.py b/doc/examples/plot_daisy.py index 35504875..128d6e67 100644 --- a/doc/examples/plot_daisy.py +++ b/doc/examples/plot_daisy.py @@ -20,7 +20,7 @@ img = data.camera() descs, descs_img = daisy(img, step=180, radius=58, rings=2, histograms=6, orientations=8, visualize=True) -f, ax = plt.subplots() +fig, ax = plt.subplots() ax.axis('off') ax.imshow(descs_img) descs_num = descs.shape[0] * descs.shape[1] diff --git a/doc/examples/plot_entropy.py b/doc/examples/plot_entropy.py index 9f208c73..b92a5bf3 100644 --- a/doc/examples/plot_entropy.py +++ b/doc/examples/plot_entropy.py @@ -22,11 +22,11 @@ fig, (ax0, ax1) = plt.subplots(ncols=2, figsize=(10, 4)) img0 = ax0.imshow(image, cmap=plt.cm.gray) ax0.set_title('Image') ax0.axis('off') -plt.colorbar(img0, ax=ax0) +fig.colorbar(img0, ax=ax0) img1 = ax1.imshow(entropy(image, disk(5)), cmap=plt.cm.jet) ax1.set_title('Entropy') ax1.axis('off') -plt.colorbar(img1, ax=ax1) +fig.colorbar(img1, ax=ax1) plt.show() diff --git a/doc/examples/plot_equalize.py b/doc/examples/plot_equalize.py index 077645a1..2d04e22a 100644 --- a/doc/examples/plot_equalize.py +++ b/doc/examples/plot_equalize.py @@ -70,7 +70,7 @@ img_eq = exposure.equalize_hist(img) img_adapteq = exposure.equalize_adapthist(img, clip_limit=0.03) # Display results -f, axes = plt.subplots(nrows=2, ncols=4, figsize=(8, 5)) +fig, axes = plt.subplots(nrows=2, ncols=4, figsize=(8, 5)) ax_img, ax_hist, ax_cdf = plot_img_and_hist(img, axes[:, 0]) ax_img.set_title('Low contrast image') @@ -92,5 +92,5 @@ ax_cdf.set_ylabel('Fraction of total intensity') ax_cdf.set_yticks(np.linspace(0, 1, 5)) # prevent overlap of y-axis labels -f.subplots_adjust(wspace=0.4) +fig.subplots_adjust(wspace=0.4) plt.show() diff --git a/doc/examples/plot_hog.py b/doc/examples/plot_hog.py index 21700089..4899c590 100644 --- a/doc/examples/plot_hog.py +++ b/doc/examples/plot_hog.py @@ -90,7 +90,7 @@ image = color.rgb2gray(data.lena()) fd, hog_image = hog(image, orientations=8, pixels_per_cell=(16, 16), cells_per_block=(1, 1), visualise=True) -f, (ax1, ax2) = plt.subplots(1, 2, figsize=(8, 4)) +fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(8, 4)) ax1.axis('off') ax1.imshow(image, cmap=plt.cm.gray) diff --git a/doc/examples/plot_holes_and_peaks.py b/doc/examples/plot_holes_and_peaks.py index d4a53f67..791c69ee 100644 --- a/doc/examples/plot_holes_and_peaks.py +++ b/doc/examples/plot_holes_and_peaks.py @@ -23,7 +23,7 @@ image = rescale_intensity(image, in_range=(50, 200)) # convenience function for plotting images def imshow(image, title, **kwargs): - f, ax = plt.subplots(figsize=(5, 4)) + fig, ax = plt.subplots(figsize=(5, 4)) ax.imshow(image, **kwargs) ax.axis('off') ax.set_title(title) diff --git a/doc/examples/plot_ihc_color_separation.py b/doc/examples/plot_ihc_color_separation.py index f7bf689e..3e297386 100644 --- a/doc/examples/plot_ihc_color_separation.py +++ b/doc/examples/plot_ihc_color_separation.py @@ -61,7 +61,7 @@ h = rescale_intensity(ihc_hed[:, :, 0], out_range=(0, 1)) d = rescale_intensity(ihc_hed[:, :, 2], out_range=(0, 1)) zdh = np.dstack((np.zeros_like(h), d, h)) -f, ax = plt.subplots() +fig, ax = plt.subplots() ax.imshow(zdh) ax.set_title("Stain separated image (rescaled)") ax.axis('off') diff --git a/doc/examples/plot_line_hough_transform.py b/doc/examples/plot_line_hough_transform.py index 271bc598..bdb05661 100644 --- a/doc/examples/plot_line_hough_transform.py +++ b/doc/examples/plot_line_hough_transform.py @@ -77,7 +77,7 @@ image[idx, idx] = 255 h, theta, d = hough_line(image) -f, ax = plt.subplots(1, 3, figsize=(8, 4)) +fig, ax = plt.subplots(1, 3, figsize=(8, 4)) ax[0].imshow(image, cmap=plt.cm.gray) ax[0].set_title('Input image') @@ -108,7 +108,7 @@ image = data.camera() edges = canny(image, 2, 1, 25) lines = probabilistic_hough_line(edges, threshold=10, line_length=5, line_gap=3) -f2, ax = plt.subplots(1, 3, figsize=(8, 3)) +fig2, ax = plt.subplots(1, 3, figsize=(8, 3)) ax[0].imshow(image, cmap=plt.cm.gray) ax[0].set_title('Input image') diff --git a/doc/examples/plot_local_equalize.py b/doc/examples/plot_local_equalize.py index 309d1e43..b3c11d55 100644 --- a/doc/examples/plot_local_equalize.py +++ b/doc/examples/plot_local_equalize.py @@ -72,7 +72,7 @@ img_eq = rank.equalize(img, selem=selem) # Display results -f, axes = plt.subplots(2, 3, figsize=(8, 5)) +fig, axes = plt.subplots(2, 3, figsize=(8, 5)) ax_img, ax_hist, ax_cdf = plot_img_and_hist(img, axes[:, 0]) ax_img.set_title('Low contrast image') @@ -87,5 +87,5 @@ ax_cdf.set_ylabel('Fraction of total intensity') # prevent overlap of y-axis labels -plt.subplots_adjust(wspace=0.4) +fig.subplots_adjust(wspace=0.4) plt.show() diff --git a/doc/examples/plot_local_otsu.py b/doc/examples/plot_local_otsu.py index ec3cdf48..d40af6b6 100644 --- a/doc/examples/plot_local_otsu.py +++ b/doc/examples/plot_local_otsu.py @@ -37,15 +37,15 @@ threshold_global_otsu = threshold_otsu(img) global_otsu = img >= threshold_global_otsu -f, ax = plt.subplots(2, 2, figsize=(8, 5)) +fig, ax = plt.subplots(2, 2, figsize=(8, 5)) ax1, ax2, ax3, ax4 = ax.ravel() -f.colorbar(ax1.imshow(img, cmap=plt.cm.gray), +fig.colorbar(ax1.imshow(img, cmap=plt.cm.gray), ax=ax1, orientation='horizontal') ax1.set_title('Original') ax1.axis('off') -f.colorbar(ax2.imshow(local_otsu, cmap=plt.cm.gray), +fig.colorbar(ax2.imshow(local_otsu, cmap=plt.cm.gray), ax=ax2, orientation='horizontal') ax2.set_title('Local Otsu (radius=%d)' % radius) ax2.axis('off') diff --git a/doc/examples/plot_medial_transform.py b/doc/examples/plot_medial_transform.py index 4182fc8d..1a8469b2 100644 --- a/doc/examples/plot_medial_transform.py +++ b/doc/examples/plot_medial_transform.py @@ -55,12 +55,12 @@ skel, distance = medial_axis(data, return_distance=True) # Distance to the background for pixels of the skeleton dist_on_skel = distance * skel -f, (ax1, ax2) = plt.subplots(1, 2, figsize=(8, 4)) +fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(8, 4)) ax1.imshow(data, cmap=plt.cm.gray, interpolation='nearest') ax1.axis('off') ax2.imshow(dist_on_skel, cmap=plt.cm.spectral, interpolation='nearest') ax2.contour(data, [0.5], colors='w') ax2.axis('off') -f.subplots_adjust(hspace=0.01, wspace=0.01, top=1, bottom=0, left=0, right=1) +fig.subplots_adjust(hspace=0.01, wspace=0.01, top=1, bottom=0, left=0, right=1) plt.show() diff --git a/doc/examples/plot_otsu.py b/doc/examples/plot_otsu.py index a679acc5..059093ab 100644 --- a/doc/examples/plot_otsu.py +++ b/doc/examples/plot_otsu.py @@ -28,7 +28,7 @@ image = camera() thresh = threshold_otsu(image) binary = image > thresh -f, (ax1, ax2, ax3) = plt.subplots(1, 3, figsize=(8, 2.5)) +fig, (ax1, ax2, ax3) = plt.subplots(1, 3, figsize=(8, 2.5)) ax1.imshow(image, cmap=plt.cm.gray) ax1.set_title('Original') ax1.axis('off') diff --git a/doc/examples/plot_peak_local_max.py b/doc/examples/plot_peak_local_max.py index ce8ccf89..cebd5738 100644 --- a/doc/examples/plot_peak_local_max.py +++ b/doc/examples/plot_peak_local_max.py @@ -25,7 +25,7 @@ image_max = ndimage.maximum_filter(im, size=20, mode='constant') coordinates = peak_local_max(im, min_distance=20) # display results -f, ax = plt.subplots(1, 3, figsize=(8, 3)) +fig, ax = plt.subplots(1, 3, figsize=(8, 3)) ax1, ax2, ax3 = ax.ravel() ax1.imshow(im, cmap=plt.cm.gray) ax1.axis('off') @@ -41,7 +41,7 @@ ax3.plot([p[1] for p in coordinates], [p[0] for p in coordinates], 'r.') ax3.axis('off') ax3.set_title('Peak local max') -f.subplots_adjust(wspace=0.02, hspace=0.02, top=0.9, +fig.subplots_adjust(wspace=0.02, hspace=0.02, top=0.9, bottom=0.02, left=0.02, right=0.98) plt.show() diff --git a/doc/examples/plot_phase_unwrap.py b/doc/examples/plot_phase_unwrap.py index 09c33f90..84e5a781 100644 --- a/doc/examples/plot_phase_unwrap.py +++ b/doc/examples/plot_phase_unwrap.py @@ -26,19 +26,19 @@ image_wrapped = np.angle(np.exp(1j * image)) # Perform phase unwrapping image_unwrapped = unwrap_phase(image_wrapped) -f, ax = plt.subplots(2, 2) +fig, ax = plt.subplots(2, 2) ax1, ax2, ax3, ax4 = ax.ravel() -f.colorbar(ax1.imshow(image, cmap='gray', vmin=0, vmax=4 * np.pi), ax=ax1) +fig.colorbar(ax1.imshow(image, cmap='gray', vmin=0, vmax=4 * np.pi), ax=ax1) ax1.set_title('Original') -f.colorbar(ax2.imshow(image_wrapped, cmap='gray', vmin=-np.pi, vmax=np.pi), ax=ax2) +fig.colorbar(ax2.imshow(image_wrapped, cmap='gray', vmin=-np.pi, vmax=np.pi), ax=ax2) ax2.set_title('Wrapped phase') -f.colorbar(ax3.imshow(image_unwrapped, cmap='gray'), ax=ax3) +fig.colorbar(ax3.imshow(image_unwrapped, cmap='gray'), ax=ax3) ax3.set_title('After phase unwrapping') -f.colorbar(ax4.imshow(image_unwrapped - image, cmap='gray'), ax=ax4) +fig.colorbar(ax4.imshow(image_unwrapped - image, cmap='gray'), ax=ax4) ax4.set_title('Unwrapped minus original') """ @@ -64,21 +64,21 @@ image_unwrapped_no_wrap_around = unwrap_phase(image_wrapped, image_unwrapped_wrap_around = unwrap_phase(image_wrapped, wrap_around=(True, False)) -f, ax = plt.subplots(2, 2) +fig, ax = plt.subplots(2, 2) ax1, ax2, ax3, ax4 = ax.ravel() -f.colorbar(ax1.imshow(np.ma.array(image, mask=mask), cmap='jet'), ax=ax1) +fig.colorbar(ax1.imshow(np.ma.array(image, mask=mask), cmap='jet'), ax=ax1) ax1.set_title('Original') -f.colorbar(ax2.imshow(image_wrapped, cmap='jet', vmin=-np.pi, vmax=np.pi), +fig.colorbar(ax2.imshow(image_wrapped, cmap='jet', vmin=-np.pi, vmax=np.pi), ax=ax2) ax2.set_title('Wrapped phase') -f.colorbar(ax3.imshow(image_unwrapped_no_wrap_around, cmap='jet'), +fig.colorbar(ax3.imshow(image_unwrapped_no_wrap_around, cmap='jet'), ax=ax3) ax3.set_title('Unwrapped without wrap_around') -f.colorbar(ax4.imshow(image_unwrapped_wrap_around, cmap='jet'), ax=ax4) +fig.colorbar(ax4.imshow(image_unwrapped_wrap_around, cmap='jet'), ax=ax4) ax4.set_title('Unwrapped with wrap_around') plt.show() diff --git a/doc/examples/plot_piecewise_affine.py b/doc/examples/plot_piecewise_affine.py index a0eddd20..b1fb551f 100644 --- a/doc/examples/plot_piecewise_affine.py +++ b/doc/examples/plot_piecewise_affine.py @@ -35,7 +35,7 @@ out_rows = image.shape[0] - 1.5 * 50 out_cols = cols out = warp(image, tform, output_shape=(out_rows, out_cols)) -f, ax = plt.subplots() +fig, ax = plt.subplots() ax.imshow(out) ax.plot(tform.inverse(src)[:, 0], tform.inverse(src)[:, 1], '.b') ax.axis((0, out_cols, out_rows, 0)) diff --git a/doc/examples/plot_pyramid.py b/doc/examples/plot_pyramid.py index c3fb6de9..8e309edf 100644 --- a/doc/examples/plot_pyramid.py +++ b/doc/examples/plot_pyramid.py @@ -30,6 +30,6 @@ for p in pyramid[1:]: composite_image[i_row:i_row + n_rows, cols:cols + n_cols] = p i_row += n_rows -f, ax = plt.subplots() +fig, ax = plt.subplots() ax.imshow(composite_image) plt.show() diff --git a/doc/examples/plot_radon_transform.py b/doc/examples/plot_radon_transform.py index 45e31ed5..04cf7bab 100644 --- a/doc/examples/plot_radon_transform.py +++ b/doc/examples/plot_radon_transform.py @@ -60,7 +60,7 @@ from skimage.transform import radon, rescale image = imread(data_dir + "/phantom.png", as_grey=True) image = rescale(image, scale=0.4) -f, (ax1, ax2) = plt.subplots(1, 2, figsize=(8, 4.5)) +fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(8, 4.5)) ax1.set_title("Original") ax1.imshow(image, cmap=plt.cm.Greys_r) @@ -73,7 +73,7 @@ ax2.set_ylabel("Projection position (pixels)") ax2.imshow(sinogram, cmap=plt.cm.Greys_r, extent=(0, 180, 0, sinogram.shape[0]), aspect='auto') -f.subplots_adjust(hspace=0.4, wspace=0.5) +fig.subplots_adjust(hspace=0.4, wspace=0.5) plt.show() """ @@ -101,7 +101,7 @@ error = reconstruction_fbp - image print('FBP rms reconstruction error: %.3g' % np.sqrt(np.mean(error**2))) imkwargs = dict(vmin=-0.2, vmax=0.2) -f, (ax1, ax2) = plt.subplots(1, 2, figsize=(8, 4.5)) +fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(8, 4.5)) ax1.set_title("Reconstruction\nFiltered back projection") ax1.imshow(reconstruction_fbp, cmap=plt.cm.Greys_r) ax2.set_title("Reconstruction error\nFiltered back projection") @@ -152,7 +152,7 @@ error = reconstruction_sart - image print('SART (1 iteration) rms reconstruction error: %.3g' % np.sqrt(np.mean(error**2))) -f, ax = plt.subplots(2, 2, figsize=(8, 8.5)) +fig, ax = plt.subplots(2, 2, figsize=(8, 8.5)) ax1, ax2, ax3, ax4 = ax.ravel() ax1.set_title("Reconstruction\nSART") ax1.imshow(reconstruction_sart, cmap=plt.cm.Greys_r) diff --git a/doc/examples/plot_random_walker_segmentation.py b/doc/examples/plot_random_walker_segmentation.py index 2f7d08b8..fa70e503 100644 --- a/doc/examples/plot_random_walker_segmentation.py +++ b/doc/examples/plot_random_walker_segmentation.py @@ -58,7 +58,7 @@ markers[data > 1.3] = 2 labels = random_walker(data, markers, beta=10, mode='bf') # Plot results -f, (ax1, ax2, ax3) = plt.subplots(1, 3, figsize=(8, 3.2)) +fig, (ax1, ax2, ax3) = plt.subplots(1, 3, figsize=(8, 3.2)) ax1.imshow(data, cmap='gray', interpolation='nearest') ax1.axis('off') ax1.set_title('Noisy data') @@ -69,6 +69,6 @@ ax3.imshow(labels, cmap='gray', interpolation='nearest') ax3.axis('off') ax3.set_title('Segmentation') -f.subplots_adjust(hspace=0.01, wspace=0.01, top=1, bottom=0, left=0, +fig.subplots_adjust(hspace=0.01, wspace=0.01, top=1, bottom=0, left=0, right=1) plt.show() diff --git a/doc/examples/plot_ransac.py b/doc/examples/plot_ransac.py index 1fce1b3d..770e8cd1 100644 --- a/doc/examples/plot_ransac.py +++ b/doc/examples/plot_ransac.py @@ -45,7 +45,7 @@ line_x = np.arange(-250, 250) line_y = model.predict_y(line_x) line_y_robust = model_robust.predict_y(line_x) -f, ax = plt.subplots() +fig, ax = plt.subplots() ax.plot(data[inliers, 0], data[inliers, 1], '.b', alpha=0.6, label='Inlier data') ax.plot(data[outliers, 0], data[outliers, 1], '.r', alpha=0.6, diff --git a/doc/examples/plot_regional_maxima.py b/doc/examples/plot_regional_maxima.py index f7b125f1..dd676014 100644 --- a/doc/examples/plot_regional_maxima.py +++ b/doc/examples/plot_regional_maxima.py @@ -50,7 +50,7 @@ ax3.imshow(image - dilated) ax3.set_title('image - dilated') ax3.axis('off') -plt.tight_layout() +fig.tight_layout() """ @@ -98,7 +98,7 @@ ax3.axhline(yslice, color='r', alpha=0.4) ax3.set_title('image - dilated') ax3.axis('off') -plt.tight_layout() +fig.tight_layout() plt.show() """ diff --git a/doc/examples/plot_regionprops.py b/doc/examples/plot_regionprops.py index e989c709..065bae55 100644 --- a/doc/examples/plot_regionprops.py +++ b/doc/examples/plot_regionprops.py @@ -26,7 +26,7 @@ image = rotate(image, angle=15, order=0) label_img = label(image) regions = regionprops(label_img) -f, ax = plt.subplots() +fig, ax = plt.subplots() ax.imshow(image, cmap=plt.cm.gray) for props in regions: diff --git a/doc/examples/plot_skeleton.py b/doc/examples/plot_skeleton.py index 3346490f..a4a3a60c 100644 --- a/doc/examples/plot_skeleton.py +++ b/doc/examples/plot_skeleton.py @@ -47,7 +47,7 @@ image[circle2] = 0 skeleton = skeletonize(image) # display results -f, (ax1, ax2) = plt.subplots(1, 2, figsize=(8, 4.5)) +fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(8, 4.5)) ax1.imshow(image, cmap=plt.cm.gray) ax1.axis('off') @@ -57,7 +57,7 @@ ax2.imshow(skeleton, cmap=plt.cm.gray) ax2.axis('off') ax2.set_title('skeleton', fontsize=20) -f.subplots_adjust(wspace=0.02, hspace=0.02, top=0.98, +fig.subplots_adjust(wspace=0.02, hspace=0.02, top=0.98, bottom=0.02, left=0.02, right=0.98) plt.show() diff --git a/doc/examples/plot_ssim.py b/doc/examples/plot_ssim.py index 4e657150..319c72fe 100644 --- a/doc/examples/plot_ssim.py +++ b/doc/examples/plot_ssim.py @@ -45,7 +45,7 @@ def mse(x, y): img_noise = img + noise img_const = img + abs(noise) -f, (ax0, ax1, ax2) = plt.subplots(nrows=1, ncols=3, figsize=(8, 4)) +fig, (ax0, ax1, ax2) = plt.subplots(nrows=1, ncols=3, figsize=(8, 4)) mse_none = mse(img, img) ssim_none = ssim(img, img, dynamic_range=img.max() - img.min()) diff --git a/doc/examples/plot_swirl.py b/doc/examples/plot_swirl.py index 98226a20..8f79db94 100644 --- a/doc/examples/plot_swirl.py +++ b/doc/examples/plot_swirl.py @@ -74,7 +74,7 @@ from skimage.transform import swirl image = data.checkerboard() swirled = swirl(image, rotation=0, strength=10, radius=120, order=2) -f, (ax0, ax1) = plt.subplots(1, 2, figsize=(8, 3)) +fig, (ax0, ax1) = plt.subplots(1, 2, figsize=(8, 3)) ax0.imshow(image, cmap=plt.cm.gray, interpolation='none') ax0.axis('off')