Advertisement
Guest User

Untitled

a guest
Aug 18th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.62 KB | None | 0 0
  1. documentclass{article}
  2.  
  3. usepackage{pgfplots}
  4. pgfplotsset{compat=newest}
  5.  
  6. pagestyle{empty}
  7. usepgfplotslibrary{dateplot}
  8.  
  9. begin{document}
  10. % requires usepgfplotslibrary{dateplot} !
  11. begin{tikzpicture}
  12. begin{axis}[
  13. date coordinates in=x,
  14. xtick=data,
  15. xticklabel style=
  16. {rotate=90,anchor=near xticklabel},
  17. xticklabel=day. hour:minute,
  18. date ZERO=2009-08-18
  19. ]
  20. addplot coordinates {
  21. (2009-08-18 09:00, 050)
  22. (2009-08-18 12:00, 100)
  23. (2009-08-18 15:00, 100)
  24. (2009-08-18 18:35, 100)
  25. (2009-08-18 21:30, 040)
  26. (2009-08-19, 020)
  27. (2009-08-19 3:00, 000)
  28. (2009-08-19 6:0, 035)
  29. };
  30. end{axis}
  31. end{tikzpicture}
  32.  
  33. end{document}
  34.  
  35. documentclass{article}
  36.  
  37. usepackage{pgfplots}
  38. pgfplotsset{compat=newest}
  39.  
  40. pagestyle{empty}
  41. usepgfplotslibrary{dateplot}
  42.  
  43. makeatletter
  44. newcommand{nonmiltime}{%
  45. ifnumhour>12
  46. expandaftertwo@digitsexpandafter{thenumexprhour-12relax}%
  47. else
  48. expandaftertwo@digitsexpandafter{hour}%
  49. fi
  50. :minute,%
  51. ifnumhour>11
  52. textsc{pm}%
  53. else
  54. textsc{am}%
  55. fi
  56. }
  57. makeatother
  58.  
  59. begin{document}
  60. % requires usepgfplotslibrary{dateplot} !
  61. begin{tikzpicture}
  62. begin{axis}[
  63. date coordinates in=x,
  64. xtick=data,
  65. xticklabel style=
  66. {rotate=90,anchor=near xticklabel},
  67. xticklabel=day. nonmiltime,
  68. date ZERO=2009-08-18
  69. ]
  70. addplot coordinates {
  71. (2009-08-18 09:00, 050)
  72. (2009-08-18 12:00, 100)
  73. (2009-08-18 15:00, 100)
  74. (2009-08-18 18:35, 100)
  75. (2009-08-18 21:30, 040)
  76. (2009-08-19, 020)
  77. (2009-08-19 3:00, 000)
  78. (2009-08-19 6:0, 035)
  79. };
  80. end{axis}
  81. end{tikzpicture}
  82.  
  83. end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement