dst-end.tex 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. \documentclass[varwidth=false, border=2pt]{standalone}
  2. \usepackage{pgfplots}
  3. \usepackage{tikz}
  4. \begin{document}
  5. \begin{tikzpicture}
  6. \begin{axis}[
  7. axis x line=middle,
  8. axis y line=middle,
  9. grid = major,
  10. width=8cm,
  11. height=8cm,
  12. grid style={dashed, gray!30},
  13. xmin= 0, % start the diagram at this x-coordinate
  14. xmax=24, % end the diagram at this x-coordinate
  15. ymin= 0, % start the diagram at this y-coordinate
  16. ymax= 24, % end the diagram at this y-coordinate
  17. xlabel=UTC of 2018-10-28,
  18. ylabel=Local time,
  19. /pgfplots/xtick={0, 2, ..., 24}, % make steps of length 2
  20. /pgfplots/ytick={0, 2, ..., 24}, % make steps of length 2
  21. x label style={at={(axis description cs:0.5,0.1)},anchor=north},
  22. tick align=outside,
  23. enlargelimits=false]
  24. % plot the function
  25. \addplot[domain=0:3, blue, ultra thick,samples=20] {x+2};
  26. \addplot[domain=3:23, blue, ultra thick,samples=20] {x+1};
  27. \addplot[domain=23:24, blue, ultra thick,samples=20] {x-23};
  28. \end{axis}
  29. \end{tikzpicture}
  30. \end{document}