Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- documentclass{article}
- usepackage{pgfplots}
- pgfplotsset{compat=newest}
- pagestyle{empty}
- usepgfplotslibrary{dateplot}
- begin{document}
- % requires usepgfplotslibrary{dateplot} !
- begin{tikzpicture}
- begin{axis}[
- date coordinates in=x,
- xtick=data,
- xticklabel style=
- {rotate=90,anchor=near xticklabel},
- xticklabel=day. hour:minute,
- date ZERO=2009-08-18
- ]
- addplot coordinates {
- (2009-08-18 09:00, 050)
- (2009-08-18 12:00, 100)
- (2009-08-18 15:00, 100)
- (2009-08-18 18:35, 100)
- (2009-08-18 21:30, 040)
- (2009-08-19, 020)
- (2009-08-19 3:00, 000)
- (2009-08-19 6:0, 035)
- };
- end{axis}
- end{tikzpicture}
- end{document}
- documentclass{article}
- usepackage{pgfplots}
- pgfplotsset{compat=newest}
- pagestyle{empty}
- usepgfplotslibrary{dateplot}
- makeatletter
- newcommand{nonmiltime}{%
- ifnumhour>12
- expandaftertwo@digitsexpandafter{thenumexprhour-12relax}%
- else
- expandaftertwo@digitsexpandafter{hour}%
- fi
- :minute,%
- ifnumhour>11
- textsc{pm}%
- else
- textsc{am}%
- fi
- }
- makeatother
- begin{document}
- % requires usepgfplotslibrary{dateplot} !
- begin{tikzpicture}
- begin{axis}[
- date coordinates in=x,
- xtick=data,
- xticklabel style=
- {rotate=90,anchor=near xticklabel},
- xticklabel=day. nonmiltime,
- date ZERO=2009-08-18
- ]
- addplot coordinates {
- (2009-08-18 09:00, 050)
- (2009-08-18 12:00, 100)
- (2009-08-18 15:00, 100)
- (2009-08-18 18:35, 100)
- (2009-08-18 21:30, 040)
- (2009-08-19, 020)
- (2009-08-19 3:00, 000)
- (2009-08-19 6:0, 035)
- };
- end{axis}
- end{tikzpicture}
- end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement