ebranlard / pyDatView

A crossplatform GUI to plot tabulated data from files (e.g. CSV, Excel, OpenFAST, HAWC2, Flex...), or python pandas dataframes
MIT License
107 stars 41 forks source link

Measuring dates/time #162

Closed Carlos-manriqu closed 11 months ago

Carlos-manriqu commented 1 year ago

Hi Mate,

it would be great if the measurement section could show the times/dates as proper dates/times instead of numerical value [also the delta x show difference in time]

Screenshot 2023-07-28 115953
ebranlard commented 1 year ago

Hey, Can you provide a small example file for me to test? (5-10 values would be enough) Thanks a lot!

Carlos-manriqu commented 1 year ago

sure thing Processed Data.csv

ebranlard commented 12 months ago

Dear @Carlos-manriqu Thank you for your patience. I've just pushed a commit that should address the issue you were seeing. The main issue is that matplolib handles datetimes using it's own numerical representation. So we need to convert these numerical values back to a date format using matplotlib.dates.date2num.

Right now, dates are displayed in a very long format. I've setup a placeholder to change this format in common.py pretty_date. The idea would be to display a different date format based on the "resolution" and "timespan" of the plot (if the dt is in days, no need for the seconds, if the dt is in miliseconds, no need for year month, etc.) But I didn't get to it.

Let me know if it works!