python - How to remove matplotlib axis from multiple plots? -
i have multiple subplots cant seem remove axis of plots, 1 of them. best way this?
import numpy np import matplotlib.pyplot plt array_list = [np.random.random_integers(0, i, (5,5)).astype(bool) in range(10)] count = 0 fig, axes = plt.subplots(nrows=2, ncols=5) in range(2): j in range(5): axes[i, j].imshow(array_list[count], interpolation='nearest') count += 1 plt.axis('off') plt.show()
you need turn off axis each subplot. try following code , see if want.
import numpy np import matplotlib.pyplot plt array_list = [np.random.random_integers(0, i, (5,5)).astype(bool) in range(10)] count = 0 fig, axes = plt.subplots(nrows=2, ncols=5) in range(2): j in range(5): axes[i, j].imshow(array_list[count], interpolation='nearest') count += 1 axes[i, j].axis('off') plt.show()
Comments
Post a Comment