Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have a data set that has values for a set of dates, but these dates don't have a regular interval (i.e. 1 Feb., 3 Feb., 15 Feb., 5 March) . So my question is: is there a package or other method to plot this easily?

share|improve this question
pst-plot provides such a requirement. –  Fifa Earth Cup 2014 Dec 31 '12 at 9:37
add comment

1 Answer

up vote 9 down vote accepted

A possible approach is the pgfplots package with the dateplot library.

Here is an example with fictitious data and the dates you provided in the question:

\pgfplotsset{compat=1.7} % with TeXLive updated this is the current version; use the one you have installed
\usepackage{filecontents}% to generate fictitious data
date incoming
2012-02-01 1500
2012-02-03 1275
2012-02-15 1480
2012-03-03 1600

  date coordinates in=x,
  xticklabel style={rotate=-45,font=\footnotesize},
  stack plots=y,
  ylabel=Total incoming,
  ylabel style={yshift=10pt},
\addplot table[x=date,y=incoming] {data.dat};

The result:

enter image description here

For further details refer to section 4.20.2 Dates as Input Coordinates of the pgfplots manual.

share|improve this answer
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.