mirror of
https://github.com/wassname/scikit-image.git
synced 2026-08-16 11:27:48 +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:
@@ -48,8 +48,8 @@ import matplotlib.pyplot as plt
|
||||
image = data.astronaut()
|
||||
|
||||
fig = plt.figure(figsize=(14, 7))
|
||||
ax_each = fig.add_subplot(121)
|
||||
ax_hsv = fig.add_subplot(122)
|
||||
ax_each = fig.add_subplot(121, adjustable='box-forced')
|
||||
ax_hsv = fig.add_subplot(122, sharex=ax_each, sharey=ax_each, adjustable='box-forced')
|
||||
|
||||
# We use 1 - sobel_each(image)
|
||||
# but this will not work if image is not normalized
|
||||
@@ -107,7 +107,7 @@ def sobel_gray(image):
|
||||
return filters.sobel(image)
|
||||
|
||||
fig = plt.figure(figsize=(7, 7))
|
||||
ax = fig.add_subplot(111)
|
||||
ax = fig.add_subplot(111, sharex=ax_each, sharey=ax_each, adjustable='box-forced')
|
||||
|
||||
# We use 1 - sobel_gray(image)
|
||||
# but this will not work if image is not normalized
|
||||
|
||||
Reference in New Issue
Block a user