histogram-large-1d-dataset.template.tex 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. \documentclass[margin=10pt]{standalone}
  2. \usepackage{amsmath}
  3. \usepackage{pgfplots}
  4. \pgfplotsset{compat=1.3}
  5. \newcommand\clipright[1][white]{
  6. \fill[#1](current axis.south east)rectangle(current axis.north-|current axis.outer east);
  7. \pgfresetboundingbox
  8. \useasboundingbox(current axis.outer south west)rectangle([xshift=.5ex]current axis.outer north-|current axis.east);
  9. }
  10. \definecolor{mycolor}{rgb}{0.02,0.4,0.7}
  11. \begin{document}
  12. \begin{tikzpicture}
  13. \begin{axis}[
  14. ymajorgrids,
  15. xmajorgrids,
  16. grid style={white,thick},
  17. axis on top,
  18. /tikz/ybar interval,
  19. tick align=outside,
  20. ymin=0,
  21. axis line style={draw opacity=0},
  22. tick style={draw=none},
  23. enlarge x limits=false,
  24. height=7cm,
  25. title={All Results},
  26. title style={font=\Large},
  27. xlabel={recording time $t$ in s},
  28. ylabel={Number of Recordings},
  29. ytick={ {{yticks}} },
  30. scaled ticks=false,
  31. yticklabels={ {{yticklabels}} },
  32. xticklabels={ {{xticklabels}} },
  33. width=\textwidth,
  34. xtick=data,
  35. label style={font=\large},
  36. ticklabel style={
  37. inner sep=1pt,
  38. font=\small
  39. },
  40. nodes near coords,
  41. every node near coord/.append style={
  42. fill=white,
  43. anchor=mid west,
  44. shift={(3pt,4pt)},
  45. inner sep=0,
  46. font=\footnotesize,
  47. rotate=45},
  48. ]
  49. \addplot[mycolor!80!white, fill=mycolor, draw=none] coordinates { {{coordinates}} };
  50. \end{axis}
  51. \clipright
  52. \end{tikzpicture}
  53. \end{document}