Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- documentclass{article}
- usepackage{pgfplots}
- pgfplotsset{width=14cm,compat=newest}
- usepgfplotslibrary{dateplot}
- begin{filecontents*}{data.csv}
- count date
- 38 2015-01-28
- 5 2015-02-11
- 21 2015-02-15
- 1 2015-02-16
- 21 2015-02-17
- 21 2015-02-18
- 62 2015-02-19
- 16 2015-02-25
- 4 2015-02-26
- 1 2015-02-30
- 1 2015-03-07
- 44 2015-04-07
- end{filecontents*}
- begin{document}
- begin{tikzpicture}
- pgfplotstableread{data.csv}table
- begin{axis}[
- date coordinates in = x,
- date ZERO = 2015-01-28,
- ymin = 0,
- x tick label style = {font = small, text width = 1.7cm, align = center, rotate = 70, anchor = north east},
- xtick = data,
- xticklabels from table = table{date}
- ]
- addplot [only marks, blue] table [x = date, y = count] table;%
- addplot [green] table [x = date, y = count] table;%
- end{axis}
- end{tikzpicture}
- end{document}
- documentclass{article}
- usepackage{pgfplots,pgfplotstable}
- usepackage{filecontents}
- pgfplotsset{width=14cm,compat=1.12}
- begin{filecontents*}{data.csv}
- count date
- 38 2015-01-28
- 5 2015-02-11
- 21 2015-02-15
- 1 2015-02-16
- 21 2015-02-17
- 21 2015-02-18
- 62 2015-02-19
- 16 2015-02-25
- 4 2015-02-26
- 1 2015-02-30
- 1 2015-03-07
- 44 2015-04-07
- end{filecontents*}
- begin{document}
- begin{tikzpicture}
- pgfplotstableread{data.csv}data
- begin{axis}[
- ymin = 0,
- x tick label style = {font = small, text width = 1.7cm, align = center, rotate = 70, anchor = north east},
- xtick=data,
- xticklabels from table = data{date}
- ]
- addplot [green,mark=*, mark options={blue}] table [x expr=coordindex, y = count] data;
- end{axis}
- end{tikzpicture}
- end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement