from jolymer.sas.sphere import sphere_fitfunc
from jolymer import jocolors as joc

import matplotlib.pyplot as plt
import numpy as np
plt.style.use('../jowebstyle.mplstyle')

fig, ax = plt.subplots()
ax.set_prop_cycle(color=[joc.Magenta, joc.Cyan, joc.GreenYellow],
                  marker=[None, None, None])

xdata = np.logspace(-2, 2, num=100000)
b4 = sphere_fitfunc(xdata,10, 1.)
b4b = sphere_fitfunc(xdata,10, 10)
b4c = sphere_fitfunc(xdata,10, 100)

ax.loglog(xdata, b4c, color=joc.Red, label='$R=100$ nm')
ax.loglog(xdata, b4b, color=joc.Blue, label='$R=10$ nm')
ax.loglog(xdata, b4, color=joc.Green, label='$R=1$ nm')
ax.set_ylabel('$P(q)$ [A.U.]')
ax.set_xlabel('$q\\,\\mathrm{[nm^{-1}]}$')
ax.set_ylim(1e-15, 1e3)
ax.legend()

plt.savefig('/home/johannes/jorepos/jowebsite/figures/saxs/sphere-Pq.svg')
plt.show()
