changed f to fig

This commit is contained in:
Siva Prasad Varma
2014-03-19 17:18:33 +05:30
parent febb4f09ca
commit a89dd4dedd
26 changed files with 50 additions and 50 deletions
+4 -4
View File
@@ -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)