From 2cb4f653ffb58f6016ee6d0a4915a5ff6db642b1 Mon Sep 17 00:00:00 2001 From: Siva Prasad Varma Date: Fri, 14 Mar 2014 22:42:20 +0530 Subject: [PATCH] made plot loop more readable --- doc/examples/plot_glcm.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/examples/plot_glcm.py b/doc/examples/plot_glcm.py index 30ee8da7..af9b4168 100644 --- a/doc/examples/plot_glcm.py +++ b/doc/examples/plot_glcm.py @@ -58,7 +58,7 @@ fig = plt.figure(figsize=(8, 8)) # display original image with locations of patches ax = fig.add_subplot(3, 2, 1) ax.imshow(image, cmap=plt.cm.gray, interpolation='nearest', - vmin=0, vmax=255) + vmin=0, vmax=255) for (y, x) in grass_locations: ax.plot(x + PATCH_SIZE / 2, y + PATCH_SIZE / 2, 'gs') for (y, x) in sky_locations: @@ -80,13 +80,13 @@ ax.legend() # display the image patches for i, patch in enumerate(grass_patches): - ax = fig.add_subplot(3, 4, 4+i+1) + ax = fig.add_subplot(3, len(grass_patches), len(grass_patches)*1 + i + 1) ax.imshow(patch, cmap=plt.cm.gray, interpolation='nearest', vmin=0, vmax=255) ax.set_xlabel('Grass %d' % (i + 1)) for i, patch in enumerate(sky_patches): - ax = fig.add_subplot(3, 4, 4*2+i+1) + ax = fig.add_subplot(3, len(sky_patches), len(sky_patches)*2 + i + 1) ax.imshow(patch, cmap=plt.cm.gray, interpolation='nearest', vmin=0, vmax=255) ax.set_xlabel('Sky %d' % (i + 1))