xsize=8.5
ysize=10.2
size xsize ysize

!box xsize ysize fill rgb(0,0.788235,0)

begin texpreamble
    % set fonts used for text and maths to Palatino
    \usepackage{mathpazo}
    \renewcommand{\familydefault}{ppl}
    \usepackage{upgreek}
    \usepackage[load=abbr]{siunitx}
end texpreamble

pt=0.0352777778 ! 1 postscript point

set font texcmr
set hei 12*pt

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

xgraphsize=4.3
ygraphsize=2

yoffset=0.2
xleft=0.7
ytop=ysize-ygraphsize
ygraphmove=1.4
glw=2*lw

! graph settings
xmn=0
xmx=8
ymn=0
ymx=0.3
xtcks=2
xsubtcks=1
ytcks=0.1
ysubtcks=0.05

amove xleft ytop-ygraphmove*5-0.3
begin graph
 size xgraphsize ygraphsize
 xaxis min xmn max xmx dticks xtcks dsubticks xsubtcks
 xtitle "\tex{$\nu$ (\si{\MHz})}"
 xaxis format "fix 0 prepend \tex{$ append $}" ! makes axis labels TeX. Must give format first.
 xticks length tt
 yaxis min ymn max ymx dticks ytcks dsubticks ysubtcks
 yaxis format "round 1 prepend \tex{$ append $}" ! makes axis labels TeX. Must give format first.
 yticks length tt
 data Ba2NaOsO6-freq-sliding-mu.tsv d1=c6,c1
 let d1=d1
 d1 color rgb(1,0.05098,0.05098) lstyle 1 lwidth glw
 let d2=1 from 1.4 to 1.6
 let d4=1 from 3.8 to 4.0
 fill x1,d2 color rgb(0.8,0.8,0.8)
 fill x1,d4 color rgb(0.8,0.8,0.8)
end graph

begin key
 nobox
 position tr
 text "\tex{$1\mu _{\mathrm{B}}$}"
end key

amove xleft ytop-ygraphmove*4
begin graph
 size xgraphsize ygraphsize
 xaxis min xmn max xmx dticks xtcks dsubticks xsubtcks
 xlabels off
 xticks length tt
 yaxis min ymn max ymx dticks ytcks dsubticks ysubtcks nolast
 yaxis format "round 1 prepend \tex{$ append $}" ! makes axis labels TeX. Must give format first.
 yticks length tt
 data Ba2NaOsO6-freq-sliding-mu.tsv d1=c5,c1
 let d1=d1/0.4
 d1 color rgb(1,0.05098,0.05098) lstyle 1 lwidth glw
 let d2=1 from 1.4 to 1.6
 let d3=d1 from 1.4 to 1.6
 let d4=1 from 3.8 to 4.0
 let d5=d1 from 3.8 to 4.0
 fill d2,d3 color rgb(0.8,0.8,0.8)
 fill x1,d3 color rgb(0,0.788235,0)
 fill d4,d5 color rgb(0.8,0.8,0.8)
 fill x1,d5 color rgb(0,0.788235,0)
end graph

begin key
 nobox
 position tr
 text "\tex{$0.4\mu _{\mathrm{B}}$}"
end key

amove xleft ytop-ygraphmove*3
begin graph
 size xgraphsize ygraphsize
 xaxis min xmn max xmx dticks xtcks dsubticks xsubtcks
 xlabels off
 xticks length tt
 yaxis min ymn max ymx dticks ytcks dsubticks ysubtcks nolast
 yaxis format "round 1 prepend \tex{$ append $}" ! makes axis labels TeX. Must give format first.
 yticks length tt
 data Ba2NaOsO6-freq-sliding-mu.tsv d1=c4,c1
 let d1=d1/0.3
 d1 color rgb(1,0.05098,0.05098) lstyle 1 lwidth glw
 let d2=1 from 1.4 to 1.6
 let d3=d1 from 1.4 to 1.6
 let d4=1 from 3.8 to 4.0
 let d5=d1 from 3.8 to 4.0
 fill d3,d2 color rgb(0.8,0.8,0.8)
 fill x1,d3 color rgb(0,0.788235,0)
 fill d5,d4 color rgb(0.8,0.8,0.8)
 fill x1,d5 color rgb(0,0.788235,0)
end graph

begin key
 nobox
 position tr
 text "\tex{$0.3\mu _{\mathrm{B}}$}"
end key

amove xleft ytop-ygraphmove*2
begin graph
 size xgraphsize ygraphsize
 nobox
 ytitle "\tex{$f(\nu)$ (\si{\per\MHz})}"
 xaxis min xmn max xmx dticks xtcks dsubticks xsubtcks
 xlabels off
 xticks length tt
 yaxis min ymn max ymx dticks ytcks dsubticks ysubtcks nolast
 yaxis format "round 1 prepend \tex{$ append $}" ! makes axis labels TeX. Must give format first.
 yticks length tt
 data Ba2NaOsO6-freq-sliding-mu.tsv d1=c3,c1
 let d1=d1/0.2
 d1 color rgb(1,0.05098,0.05098) lstyle 1 lwidth glw
 let d2=1 from 1.4 to 1.6
 let d3=d1 from 1.4 to 1.6
 let d4=1 from 3.8 to 4.0
 let d5=d1 from 3.8 to 4.0
 fill d3,d2 color rgb(0.8,0.8,0.8)
 fill x1,d3 color rgb(0,0.788235,0)
 fill d5,d4 color rgb(0.8,0.8,0.8)
 fill x1,d5 color rgb(0,0.788235,0)
end graph

begin key
 nobox
 position tr
 text "\tex{$0.2\mu _{\mathrm{B}}$}"
end key

amove xleft ytop-ygraphmove
begin graph
 size xgraphsize ygraphsize
 xaxis min xmn max xmx dticks xtcks dsubticks xsubtcks
 xlabels off
 xticks length tt
 yaxis min ymn max ymx dticks ytcks dsubticks ysubtcks nolast
 yaxis format "round 1 prepend \tex{$ append $}" ! makes axis labels TeX. Must give format first.
 yticks length tt
 data Ba2NaOsO6-freq-sliding-mu.tsv d1=c2,c1
 let d1=d1/0.1
 d1 color rgb(1,0.05098,0.05098) lstyle 1 lwidth glw deresolve 5 average
 let d2=1 from 1.4 to 1.6
 let d3=d1 from 1.4 to 1.6
 let d4=1 from 3.8 to 4.0
 let d5=d1 from 3.8 to 4.0
 fill d3,d2 color rgb(0.8,0.8,0.8)
 fill x1,d3 color rgb(0,0.788235,0)
 fill d5,d4 color rgb(0.8,0.8,0.8)
 fill x1,d5 color rgb(0,0.788235,0)
end graph

begin key
 nobox
 position tr
 text "\tex{$0.1\mu _{\mathrm{B}}$}"
end key

amove xleft ytop
begin graph
 size xgraphsize ygraphsize
 xaxis min xmn max xmx dticks xtcks dsubticks xsubtcks
 xlabels off
 xticks length tt
 yaxis min ymn max ymx dticks ytcks dsubticks ysubtcks
 yaxis format "round 1 prepend \tex{$ append $}" ! makes axis labels TeX. Must give format first.
 yticks length tt
 data zero-dummy.tsv d1=c1,c2
 let d1=d1
 d1 color rgb(1,0.05098,0.05098) lstyle 1 lwidth glw
 let d2=1 from 1.4 to 1.6
 !let d3=d1 from 1.4 to 1.6
 let d4=1 from 3.8 to 4.0
 !let d5=d1 from 3.8 to 4.0
 !fill d3,d2 color rgb(0.8,0.8,0.8)
 !fill x1,d3 color rgb(0,0.788235,0)
 !fill d5,d4 color rgb(0.8,0.8,0.8)
 !fill x1,d5 color rgb(0,0.788235,0)
 fill x1,d2 color rgb(0.8,0.8,0.8)
 fill x1,d4 color rgb(0.8,0.8,0.8)
end graph

begin key
 nobox
 position tr
 text "\tex{$0\mu _{\mathrm{B}}$}"
end key

!begin key
! nobox
! position tr
! llen 0.78
! text "\tex{\hspace{4.25pt} FM $[1\,1\,1]$}"
! text "\tex{AFM $[1\,1\,1]$}"
! text "\tex{AFM $[0\,0\,1]$}"
! separator
! color rgb(1,0.05098,0.05098) lstyle 1 lwidth glw
! color rgb(0.082353,0.258824,0.388235) lstyle 5 lwidth glw
! color rgb(0.372549,0.619608,0.803922) lstyle 3 lwidth glw
!end key

!begin key
! nobox
! position tl
! text "\tex{(a)}"
!end key

! graph settings
xmn=0
xmx=5
ymn=0
ymx=0.5

amove 4.2 0.5
! this graph has been rotated by using the y-axis as the x and vice-versa
begin graph
 size 3.3 10
 nobox
 y2title "\tex{$\mu$ ($\mu_{\mathrm{B}}$)}" rotate
 xtitle "\tex{~~~$g(\mu | \{\nu _{i}\})$ ($\mu_{\mathrm{B}}^{-1}$)}"
 xaxis min xmn max xmx dticks 1 dsubticks 1
 xaxis format "fix 0 prepend \tex{$ append $}" ! makes axis labels TeX. Must give format first.
 xticks length tt
 yaxis negate ! reverses the direction of the y-axis
 yaxis min ymn max ymx dticks 0.1 dsubticks 0.05
 ylabels off
 y2labels on
 y2axis format "fix 1 prepend \tex{$ append $}" ! makes axis labels TeX. Must give format first.
 yticks length tt
 data Ba2NaOsO6-muOs-pdfs.tsv d1=c2,c1
 data Ba2NaOsO6-muOs-pdfs-points.tsv d2=c2,c1
 d1 color rgb(1,0.05098,0.05098) lstyle 1 lwidth glw deresolve 3 average
 d2 color rgb(0,0.788235,0) marker wsquare msize 4*pt
 ! 'imuplses' from y-axis to nonzero points
 let d3=0.1 from 0 to 3.128105406
 let d4=0.2 from 0 to 4.429687126
 let d5=0.3 from 0 to 2.286928864
 d3 line color rgb(0,0.788235,0) lwidth glw
 d4 line color rgb(0,0.788235,0) lwidth glw
 d5 line color rgb(0,0.788235,0) lwidth glw
end graph