epezent / implot

Immediate Mode Plotting
MIT License
4.64k stars 516 forks source link

Plot with ImPlotScale_Time and X axis in microseconds #439

Closed hinxx closed 1 year ago

hinxx commented 1 year ago

My X axis data points are represented as number of microseconds from epoch. In the Demo_TimeScale demo I see that seconds are used. Can I have the X axis constructed with microsecond ticks?

epezent commented 1 year ago

You can try using the ImPlotTime struct from implot_internal.h to convert a time point consisting of second and microseond parts to double.

int s = 10;
int us = 123456;
ImPlotTime myTime(s,us); // 10.123456 s
double myDouble= t.ToDouble(); // plot this