xsize=9
ysize=7
size xsize ysize

begin texpreamble
    % set fonts used for text and maths to Palatino
    \usepackage{mathpazo}
    \renewcommand{\familydefault}{ppl}
    \usepackage{upgreek}
    \usepackage[load=abbr]{siunitx}
    \usepackage{bm}
    \usepackage{textcomp}
    \newcommand{\murm}{%
      \ifmmode
        \mathchoice
            {\hbox{\normalsize\textmu}}
            {\hbox{\normalsize\textmu}}
            {\hbox{\scriptsize\textmu}}
            {\hbox{\tiny\textmu}}%
      \else
        \textmu
      \fi
    }
end texpreamble

pt=0.0352777778 ! 1 postscript point

set font texcmr
set hei 12*pt
set texscale scale

tt=4*pt
lw=0.5*pt
set lwidth lw
set just tl

! graph settings
xgraphsize=10
ygraphsize=8
timn=0
timx=10
titicks=5
tisubticks=1
Amin=8
Amax=22

ticklength=0.1

!waterfalloffset=2

glw=2*lw
errw=glw*2
ms=2*pt ! marker size

amove 0 0
begin graph
    size xgraphsize ygraphsize
    
    data BF4-15K.dat d1=c1,c2 d2=c1,c3
    
    xtitle "\tex{$t$ (\si{\us})}"
    xaxis min timn max timx dticks titicks dsubticks tisubticks
    xaxis format "fix 0 prepend \tex{$ append $}" ! makes axis labels TeX. dec is just padding, because for some reason it doesn't work if prepend or append is first
    xticks length ticklength
    !xlabels off
    
    ytitle "\tex{$A(t)$ (\%)}"
    yaxis min Amin max Amax dticks 5 dsubticks 1
    yaxis format "fix 0 prepend \tex{$ append $}" ! makes axis labels TeX. dec is just padding, because for some reason it doesn't work if prepend or append is first
    yticks length ticklength
    
    d1 marker fcircle msize ms err d2 errwidth errw lwidth lw
end graph

begin graph
    size xgraphsize ygraphsize
    
    data BF4-15K.fit d1=c1,c2
    
    xaxis min timn max timx
    xaxis off
    
    yaxis min Amin max Amax
    yaxis off
    
    d1 line lwidth glw color rgb255(144,224,80)
end graph

!!!!!!!!!!!!!!!!!
! Fmu levels pic

linelength=2.5
sep=0.6

amove 5.7 4.4

!energy levels
rline linelength 0
rmove -linelength sep
rline linelength 0
rmove -linelength 2*sep
rline linelength 0

!transitions
set color rgb255(48,80,248)
rmove -linelength*0.8 0
rline 0 -sep*2 arrow both
rmove linelength*0.3 sep*2
rline 0 -sep*3 arrow both
rmove linelength*0.3 0
rline 0 sep arrow both

!labels
set color black
set justify cr
rmove -linelength*0.85 -sep
text \tex{$\left|\uparrow\uparrow\right\rangle$, $\left|\downarrow\downarrow\right\rangle$}
rmove 0 sep
text \tex{$\frac{1}{\sqrt{2}}\left (\left|\uparrow\downarrow\right\rangle - \left|\downarrow\uparrow\right\rangle \right )$}
rmove 0 2*sep
text \tex{$\frac{1}{\sqrt{2}}\left (\left|\uparrow\downarrow\right\rangle + \left|\downarrow\uparrow\right\rangle \right )$}