next up previous contents index
Next: Xdtics Up: Xdata Previous: Xdata   Contents   Index

Time

set xdata time indicates that the x coordinate is to be interpreted as a date or time to millisecond precision. Equivalent commands exist for set ydata time and so on.

Two separate formats control interpretation of time data. Input data is read from a file using the timefmt for that axis. See set timefmt (p. [*]). Use quoted strings in this same timefmt to specify the axis range.

Example:


    set xdata time
    set timefmt x "%d-%b-%Y"
    set xrange ["01-Jan-2013" : "31-Dec-2014"]

For output, i.e. tick labels along that axis or coordinates output by mousing, the function 'strftime' (type "man strftime" on unix to look it up) is used to convert from the internal time in seconds to a string representation of a date. gnuplot tries to figure out a reasonable format for this. You can customize the format using either set format x or set xtics format. See time_specifiers (p. [*]) for a special set of time format specifiers. See also time/date (p. [*]) for more information.


2015-04-15