2

What would be the best way to handle matlab time format with pgfplots? I have understood that pgfdateplot can only handle well yyyy.mm.dd HH:MM format but not seconds and especially nothing beyond that. How to plot data in yyyy.mm.dd HH:MM:SS.SSS format, but read it from the file that is in the matlab format:

time
7.364874167939814e+05
7.364874168184156e+05
7.364874168428498e+05
7.364874168672840e+05
7.364874168917182e+05
7.364874169161522e+05
7.364874169405864e+05
7.364874169650206e+05
7.364874169894548e+05
7.364874170138889e+05

There is one answer in question pgfplots data time format, but I'm not sure how to apply it to this situation.

Lesenger
  • 85
  • 6

1 Answers1

3

This might well be possible with pgfplots, but it's likely easier to make a new time vector in Matlab that contains the number of seconds from time zero. E.g. in Matlab do t2 = (time-time(1))*86400;, where time is the name of your original time vector. Then you can describe in the caption and/or xlabel that the x-coordinate is seconds after HH:MM:SS.SS.

Torbjørn T.
  • 206,688