mirror of
https://github.com/wassname/scikit-image.git
synced 2026-08-13 12:40:24 +08:00
added sharex, sharey and adjustable parameters to subplots
This commit is contained in:
@@ -101,7 +101,7 @@ error = reconstruction_fbp - image
|
|||||||
print('FBP rms reconstruction error: %.3g' % np.sqrt(np.mean(error**2)))
|
print('FBP rms reconstruction error: %.3g' % np.sqrt(np.mean(error**2)))
|
||||||
|
|
||||||
imkwargs = dict(vmin=-0.2, vmax=0.2)
|
imkwargs = dict(vmin=-0.2, vmax=0.2)
|
||||||
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(8, 4.5))
|
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(8, 4.5), sharex=True, sharey=True, subplot_kw={'adjustable':'box-forced'})
|
||||||
ax1.set_title("Reconstruction\nFiltered back projection")
|
ax1.set_title("Reconstruction\nFiltered back projection")
|
||||||
ax1.imshow(reconstruction_fbp, cmap=plt.cm.Greys_r)
|
ax1.imshow(reconstruction_fbp, cmap=plt.cm.Greys_r)
|
||||||
ax2.set_title("Reconstruction error\nFiltered back projection")
|
ax2.set_title("Reconstruction error\nFiltered back projection")
|
||||||
@@ -152,7 +152,7 @@ error = reconstruction_sart - image
|
|||||||
print('SART (1 iteration) rms reconstruction error: %.3g'
|
print('SART (1 iteration) rms reconstruction error: %.3g'
|
||||||
% np.sqrt(np.mean(error**2)))
|
% np.sqrt(np.mean(error**2)))
|
||||||
|
|
||||||
fig, ax = plt.subplots(2, 2, figsize=(8, 8.5))
|
fig, ax = plt.subplots(2, 2, figsize=(8, 8.5), sharex=True, sharey=True, subplot_kw={'adjustable':'box-forced'})
|
||||||
ax1, ax2, ax3, ax4 = ax.ravel()
|
ax1, ax2, ax3, ax4 = ax.ravel()
|
||||||
ax1.set_title("Reconstruction\nSART")
|
ax1.set_title("Reconstruction\nSART")
|
||||||
ax1.imshow(reconstruction_sart, cmap=plt.cm.Greys_r)
|
ax1.imshow(reconstruction_sart, cmap=plt.cm.Greys_r)
|
||||||
|
|||||||
Reference in New Issue
Block a user