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

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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=5cm,
  25. title style={font=\Large},
  26. xlabel={Collected Labeled Recordings},
  27. ylabel={Number of Symbols},
  28. ytick={ {{yticks}} },
  29. scaled ticks=false,
  30. yticklabels={ {{yticklabels}} },
  31. xticklabels={ {{xticklabels}} },
  32. width=\textwidth,
  33. xtick=data,
  34. label style={font=\large},
  35. ticklabel style={
  36. inner sep=1pt,
  37. font=\small
  38. },
  39. nodes near coords,
  40. every node near coord/.append style={
  41. fill=white,
  42. anchor=mid west,
  43. shift={(3pt,4pt)},
  44. inner sep=0,
  45. font=\footnotesize,
  46. rotate=45},
  47. ]
  48. \addplot[mycolor!80!white, fill=mycolor, draw=none] coordinates { {{coordinates}} };
  49. \end{axis}
  50. \clipright
  51. \end{tikzpicture}
  52. \end{document}