\documentclass{article}
\usepackage{tikz}
\usepackage{pgfplots}
\usepgfplotslibrary{dateplot}
\pgfplotsset{compat=1.11}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
date coordinates in=x,
xtick=data,xmin=2013-01-15,xmax=2014-01-15,xlabel=\bfseries\Large x,
xticklabel={\pgfcalendar{tickcal}{\tick}{\tick}{\pgfcalendarshorthand{m}{.}}},
ytick={0,5000,10000,15000},
ylabel=\bfseries\Large y,
ymin=0,ymax=15000,
height=9cm, width=14.5cm,grid=both,minor y tick num=4]
\addplot [smooth,line width=2,red] coordinates {
(2013-1-31,13811)
(2013-2-28,10396)
(2013-3-31,11563)
(2013-4-30,10512)
(2013-5-28,6290)
(2013-6-31,5453)
(2013-7-30,5920)
(2013-8-31,7264)
(2013-9-31,7215)
(2013-10-31,10481)
(2013-11-30,14485)
(2013-12-31,14375)
};
\end{axis}
\end{tikzpicture}
\end{document}
-
Interestingly, if you correct days in table of coordinates (to correct days for May, June, July and September) than instead of July will appear June.– ZarkoCommented Sep 13, 2014 at 21:37
Add a comment
|
1 Answer
June only has 30
days :)
...
\addplot [smooth,line width=2,red] coordinates {
(2013-1-31,13811)
(2013-2-28,10396)
(2013-3-31,11563)
(2013-4-30,10512)
(2013-5-28,6290)
(2013-6-30,5453)
(2013-7-31,5920)
(2013-8-31,7264)
(2013-9-30,7215)
(2013-10-31,10481)
(2013-11-30,14485)
(2013-12-31,14375)
};
...
I also corrected the days of the month for September.
-
presumably the OP meant
2013-5-28,6290
to be2013-5-31,6290
?...– cmhughesCommented Sep 13, 2014 at 22:06