import numpy as np
import matplotlib.pyplot as plt
from grains2 import FractalPorosity

porosity = FractalPorosity(0.1, 2.8)
a = np.logspace(-1, 3, 1000)

fig, ax = plt.subplots()
ax.plot(a, porosity.P(a), label="$D=2.8$")
ax.legend()
plt.setp(
    ax,
    xlabel="Radius (μm)",
    xscale="log",
    xlim=(0.1, 1000),
    ylabel="$P$",
    yscale="log",
)
plt.tight_layout()