Advertisement
Guest User

Untitled

a guest
Aug 18th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.40 KB | None | 0 0
  1. documentclass{standalone}
  2. usepackage{pgfplots}
  3. usepgfplotslibrary{dateplot}
  4. pgfplotsset{compat=1.12}
  5. usepackage{filecontents}
  6. begin{filecontents*}{data.csv}
  7. date,value
  8. 2015-01-01, 3.2
  9. 2015-01-02, 6.5
  10. 2015-01-04, 6.8
  11. end{filecontents*}
  12. begin{document}
  13. begin{tikzpicture}
  14. centering
  15. begin{axis}[
  16. date coordinates in=x,
  17. xticklabel={day-month-year},
  18. x tick label style={rotate=45,anchor=north east},
  19. date ZERO=2015-01-01,
  20. grid=both,
  21. enlarge x limits=false,
  22. xlabel={Date (day-month-year)},
  23. ylabel={Value},
  24. ]
  25. addplot table [x=date, y=value, col sep=comma] {data.csv};
  26. end{axis}
  27. end{tikzpicture}
  28. end{document}
  29.  
  30. documentclass{standalone}
  31. usepackage{pgfplots}
  32. usepackage{etoolbox}
  33. usepgfplotslibrary{dateplot}
  34. pgfplotsset{compat=1.12}
  35. usepackage{filecontents}
  36.  
  37. begin{filecontents*}{data.csv}
  38. date,value
  39. 2015-01-01, 3.2
  40. 2015-01-02, 6.5
  41. 2015-01-04, 6.8
  42. end{filecontents*}
  43. begin{document}
  44. begin{tikzpicture}
  45. centering
  46. begin{axis}[
  47. date coordinates in=x,
  48. xticklabel={day-month-year},
  49. x tick label style={rotate=45,anchor=north east},
  50. date ZERO=2015-01-01,
  51. grid=both,
  52. enlarge x limits=false,
  53. xlabel={Date (day-month-year)},
  54. ylabel={Value},
  55. xticklabel={%
  56. ifcsdef{Tick Used tick}{}{%
  57. tick%
  58. csxdef{Tick Used tick}{}%
  59. }%
  60. },
  61. ]
  62. addplot table [x=date, y=value, col sep=comma] {data.csv};
  63. end{axis}
  64. end{tikzpicture}
  65. end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement