Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. documentclass[border=5pt]{standalone}
  2. usepackage{xcolor}
  3. usepackage{tikz,pgfplots,pgfplotstable}
  4. %
  5. begin{document}
  6. centering
  7. pgfplotsset{every major tick/.style={black,},minor y tick num=1}
  8. pgfplotstableread{slope-data.dat}datatable
  9. %
  10. begin{tikzpicture}[scale=1.4]
  11. begin{loglogaxis}[
  12. axis background/.style={
  13. shade,top color=gray!60,bottom color=white},
  14. legend style={fill=white,font=scriptsize, at={(0.96,0.10)},anchor=south east},
  15. tick label style={font=scriptsize},
  16. label style={font=footnotesize},
  17. legend cell align=left,
  18. xlabel={$a$},
  19. ylabel={$N(a)$},
  20. legend entries={$r = 0.50-M=2^{0}$, $ d_mathrm{f} = pgfmathprintnumber{slope} pm $},
  21. ]
  22. %
  23. addplot+[mark=halfcircle*,only marks,every mark/.append style={rotate=90}]
  24. table[font=scriptsize] {main-data.dat};
  25. %
  26. addplot+[mark=x,mark repeat=5,mark phase=6,smooth]
  27. table[y={create col/linear regression={y=1}}]{datatable}
  28. coordinate [pos=0.3] (A)
  29. coordinate [pos=0.69] (B);
  30. % store slope
  31. xdefslope{pgfplotstableregressiona}
  32. draw [red,thick] (A) |- (B)
  33. node[anchor=east,font=scriptsize,red] at (3.33,7.8) {$sim$pgfmathprintnumber{slope}};
  34. %
  35. end{loglogaxis}
  36. end{tikzpicture}
  37. %
  38. end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement