I am trying to plot two graphs.
First one displayed randomly generated pixels and the second one eroded one.
When I plot those subplots first one does not show the grid, also Y axis numbering are reversed and origin point shifted a little bit.
Could you please advice how can i fix those issues?
Here is my code below:
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
from skimage.morphology import disk,erosion
x=np.random.randint(2,size=(10,10))
se=disk(1)
y=erosion(x,se)
fig, (ax0, ax1) = plt.subplots(1,2, figsize=(10,5))
cmap = mpl.colors.ListedColormap(['w', 'k'])
ax0.set_xticks(np.arange(0, 10, 1))
ax0.set_yticks(np.arange(0, 10, 1))
ax0.set_title("Input image")
ax1.set_xticks(np.arange(0, 10, 1))
ax1.set_yticks(np.arange(0, 10, 1))
ax1.set_title("Eroded Image")
ax0.imshow(x,interpolation='none', cmap=cmap, norm=norm)
ax1.imshow(y,interpolation='none', cmap=cmap, norm=norm)
plt.rc('grid', linestyle="-", color='red')
plt.grid(True)
plt.show()

