import numpy as np
import matplotlib.pyplot as plt
from scipy import stats
from matplotlib.ticker import MultipleLocator
plt.rcParams.update({
"text.usetex": True,
"font.family": "serif",
})
x = np.linspace(-4, 4, 500)
alpha_list = [2.0, 1.5, 1.0, 0.5]
y = [stats.levy_stable.cdf(x, alpha, 0.0) for alpha in alpha_list]
fig, ax = plt.subplots()
c = ['black', 'blue', 'lime', 'red']
for i, data in enumerate(y):
ax.plot(x, data, color=c[i], label=r'$\alpha=' + str(alpha_list[i]) + r'$')
ax.xaxis.set_minor_locator(MultipleLocator(.25))
ax.xaxis.set_major_locator(MultipleLocator(2))
ax.yaxis.set_minor_locator(MultipleLocator(.025))
ax.tick_params(axis='both', which='both', direction='in', top=True, right=True)
ax.set(ylim=(0, 1), xlim=(-4, 4))
plt.plot([], [], ' ', label=r'$\beta = 0$')
plt.plot([], [], ' ', label=r'$c=1$')
plt.plot([], [], ' ', label=r'$\mu=0$')
plt.legend(frameon=False)
fig.savefig('Levy_distributionCDF.svg', bbox_inches='tight')