Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- documentclass[border=5pt]{standalone}
- usepackage{xcolor}
- usepackage{tikz,pgfplots,pgfplotstable}
- %
- begin{document}
- centering
- pgfplotsset{every major tick/.style={black,},minor y tick num=1}
- pgfplotstableread{slope-data.dat}datatable
- %
- begin{tikzpicture}[scale=1.4]
- begin{loglogaxis}[
- axis background/.style={
- shade,top color=gray!60,bottom color=white},
- legend style={fill=white,font=scriptsize, at={(0.96,0.10)},anchor=south east},
- tick label style={font=scriptsize},
- label style={font=footnotesize},
- legend cell align=left,
- xlabel={$a$},
- ylabel={$N(a)$},
- legend entries={$r = 0.50-M=2^{0}$, $ d_mathrm{f} = pgfmathprintnumber{slope} pm $},
- ]
- %
- addplot+[mark=halfcircle*,only marks,every mark/.append style={rotate=90}]
- table[font=scriptsize] {main-data.dat};
- %
- addplot+[mark=x,mark repeat=5,mark phase=6,smooth]
- table[y={create col/linear regression={y=1}}]{datatable}
- coordinate [pos=0.3] (A)
- coordinate [pos=0.69] (B);
- % store slope
- xdefslope{pgfplotstableregressiona}
- draw [red,thick] (A) |- (B)
- node[anchor=east,font=scriptsize,red] at (3.33,7.8) {$sim$pgfmathprintnumber{slope}};
- %
- end{loglogaxis}
- end{tikzpicture}
- %
- end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement