# Generated by pandoc-plot 1.9.1
import matplotlib.pyplot as plt
import numpy as np

np.random.seed(2019)

from skued import diffread
from pathlib import Path
from scipy.ndimage import center_of_mass

im1 = diffread(Path("images") / "autocenter" / "graphite.tif")
im2 = diffread(Path("images") / "mnxc" / "Cr_1.tif")

fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(6,3))

for im, ax in zip([im1, im2], [ax1, ax2]):

    r, c = center_of_mass(im)
    ax.imshow(im, vmin=0, vmax=200, cmap='inferno')
    ax.scatter(c, r, color='r')
    ax.axis('off')

plt.tight_layout()
Click here to see how this plot was generated.