Assumed we have the following code:

Minimum Working Example (MWE):


    Date;                   Value
    2019-04-01 12:00:00;    1
    2019-04-02 12:00:00;    2
    2019-04-03 12:00:00;    3
    2019-04-04 12:00:00;    4
    2019-04-05 12:00:00;    5

        \begin{axis}[date coordinates in = x,
                     xmin                = 2019-04-02 12:00:00,
                     xticklabel          = \day,
                     table/col sep       = semicolon]
                     \addplot table[x=Date,y=Value]{data.csv};

Screenshot of the result:

Screenshot of the result


What is the difference between typing xmin = blabla and date ZERO = blabla? It seems to cause the same behavior?

  • The manual writes "pgfplots up to and including version 1.12 required this value." So this might be something that had been introduced and is no longer that useful.
    – user121799
    Apr 27 '19 at 13:52

Note: If I replace xmin in your code with date ZERO I do not get the same output.

pgfplots converts dates to a number, which corresponds to the number of days from a given date, I think. date ZERO is for setting that date used at the zero point.

The full description of the key, which marmot quoted part of:

/pgfplots/date ZERO=<year>-<month>-<day> A technical key which defines the 0 coordinate of date coordinates in.

pgfplots up to and including version 1.12 required this value. As of version 1.13, the first encountered coordinate is used as date ZERO, i.e. it is assigned automatically without user intervention.

Users will never see the resulting numbers, so one probably never needs to change this value. This key allows to set the result as needed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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