mirror of
https://github.com/wassname/scikit-image.git
synced 2026-08-04 13:14:23 +08:00
adding axes sharing to displays of related images
for better interaction sharing achieved by setting sharex and sharey, and setting the axes 'adjustable' parameter to 'box-forced'
This commit is contained in:
@@ -54,7 +54,14 @@ gamma_corrected = exposure.adjust_gamma(img, 2)
|
||||
logarithmic_corrected = exposure.adjust_log(img, 1)
|
||||
|
||||
# Display results
|
||||
fig, axes = plt.subplots(nrows=2, ncols=3, figsize=(8, 5))
|
||||
fig = plt.figure(figsize=(8, 5))
|
||||
axes = np.zeros((2,3), dtype=np.object)
|
||||
axes[0, 0] = plt.subplot(2, 3, 1, adjustable='box-forced')
|
||||
axes[0, 1] = plt.subplot(2, 3, 2, sharex=axes[0, 0], sharey=axes[0, 0], adjustable='box-forced')
|
||||
axes[0, 2] = plt.subplot(2, 3, 3, sharex=axes[0, 0], sharey=axes[0, 0], adjustable='box-forced')
|
||||
axes[1, 0] = plt.subplot(2, 3, 4)
|
||||
axes[1, 1] = plt.subplot(2, 3, 5)
|
||||
axes[1, 2] = plt.subplot(2, 3, 6)
|
||||
|
||||
ax_img, ax_hist, ax_cdf = plot_img_and_hist(img, axes[:, 0])
|
||||
ax_img.set_title('Low contrast image')
|
||||
|
||||
Reference in New Issue
Block a user