import numpy as np import matplotlib.pyplot as plt import matplotlib as mpl from matplotlib.patches import Ellipse from matplotlib import patches from src import coil_class as BC # %% my_colors = {'light_green': '#97e144', 'orange': '#FF914D', 'light_grey': '#545454', 'pastel_blue': '#1b64d1', 'light_blue': '#71C8F4', 'purple': '#7c588c'} mpl.rcParams.update({'font.size': 10, 'axes.linewidth': 1, 'lines.linewidth': 2, 'text.usetex': False, 'font.family': 'arial'}) mpl.rcParams['xtick.direction'] = 'in' mpl.rcParams['ytick.direction'] = 'in' mpl.rcParams['xtick.top'] = True mpl.rcParams['ytick.right'] = True def a_scat(B, a_bg = 1, B_0 = 0, DeltaB = 1): return a_bg * (1 - (DeltaB/(B - B_0))) mm = 1/25.4 #%% xlim = 3.9 ylim = 3.9 x_neg = np.linspace(-7, -0.0001, 500) x_pos = np.linspace(0.0001, 5, 500) color_scat = '#FF914D' color_add = '#71C8F4' color_grey = '#545454' fig, ax = plt.subplots(1, 1, figsize=(65 * mm, 55 * mm),dpi=600) plt.subplots_adjust(bottom=0.17, left=0.17) ax.grid(alpha= 0.4) ax.hlines(132/80, -xlim, xlim, color=color_add, linestyles=(2, (2, 2)), zorder=2) ax.plot(x_neg, a_scat(x_neg), color=color_scat, zorder=1) ax.plot(x_pos, a_scat(x_pos), color=color_scat, zorder=1) # plt.ylim(-ylim, ylim) ax.vlines(0, -ylim, ylim, color='grey', linestyles='dotted', zorder=0) ax.hlines(0, -xlim, xlim, color='grey', linestyles='dotted', zorder=0) ax.text(2.6, 132/80 + 0.3, r'a$_{\rm dd}$', color=color_add) ax.arrow(0, 0, 1, 0, length_includes_head=True, width=0.15, head_length = 0.3, color=color_grey, zorder=2) ax.text(0.14, 0.36, r'$\Delta_{\rm FR}$', color=color_grey, fontweight='bold') mpl.patches.Rectangle((-xlim,0), 5, 1.2) # plt.xticks() ax.set_xlim(-xlim, xlim) ax.set_ylim(-ylim, ylim) ax.set_xticks(np.arange(-3,4,2)) ax.set_yticks(np.arange(-3, 4, 2)) ax.set_ylabel(r'a$_{\rm S}$/a$_{\rm bg}$') ax.set_xlabel(r'(B-B$_0$)/$\Delta_{\rm FR}$') ax.yaxis.set_label_coords(-0.12,0.5) ax.xaxis.set_label_coords(0.5,-0.12) plt.savefig('scattering.svg') #plt.tight_layout() plt.show()