updating examples to stop matplotlib complaining
import porespy as ps
import matplotlib.pyplot as plt
-import scipy as sp
+import numpy as np
import scipy.ndimage as spim
# Generate an image of spheres using the imgen class
@@ -13,12 +13,8 @@ chords = ps.filters.apply_chords(im=im, trim_edges=False)
colored_chords = ps.filters.region_size(chords)
h = ps.metrics.chord_length_distribution(chords, bins=25)
ps.visualization.set_mpl_style()
-plt.figure(2)
-plt.subplot(2, 2, 1)
-plt.imshow(im)
-plt.subplot(2, 2, 3)
-plt.imshow(chords)
-plt.subplot(2, 2, 4)
-plt.imshow(colored_chords, cmap=plt.cm.jet)
-plt.subplot(2, 2, 2)
-plt.bar(h.L, h.pdf, width=h.bin_widths, edgecolor='k')
+fig, ax = plt.subplots(2, 2)
+ax[0][0].imshow(im)
+ax[0][1].imshow(chords)
+ax[1][0].imshow(colored_chords, cmap=plt.cm.jet)
+ax[1][1].bar(h.L, h.pdf, width=h.bin_widths, edgecolor='k')
