Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. documentclass[tikz,border=3.14mm]{standalone}
  2. usepackage{pgfplots}
  3.  
  4. begin{filecontents}{example.dat}
  5. 71
  6. 54
  7. 55
  8. 54
  9. 98
  10. 76
  11. 93
  12. 95
  13. 86
  14. 88
  15. 68
  16. 68
  17. 50
  18. 61
  19. 79
  20. 79
  21. 73
  22. 57
  23. 56
  24. 57
  25. 97
  26. 80
  27. 91
  28. 94
  29. 85
  30. 88
  31. 45
  32. 58
  33. 78
  34. 81
  35. 74
  36. 60
  37. 57
  38. 58
  39. 95
  40. 81
  41. end{filecontents}
  42.  
  43. begin{document}
  44. begin{tikzpicture}
  45. begin{axis}[ybar, ymin=0]
  46.  
  47. addplot[fill=black,
  48. hist={
  49. bins=11
  50. }] table [y index=0] {example.dat};
  51.  
  52. end{axis}
  53. end{tikzpicture}
  54.  
  55. end{document}
  56.  
  57. pgfplotstableread{example.dat}table
  58. pgfplotstablegetrowsof{table}
  59. pgfmathsetmacro{R}{pgfplotsretval-1}
  60.  
  61. pgfplotsinvokeforeach{0,...,R}{
  62. pgfplotstablegetelem{#1}{0}of{table}
  63. pgfmathsetmacro value {pgfplotsretval}
  64. % sum up all e^0.5(value-x)/sigma somhow
  65. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement