Search code examples
gnuplotscientific-notation

gnuplot converting time to scientific notation


I have this program that grabs a lot of usage details regarding your computer and plots everything on a nice graph (below). The issue I am running into is that in the bottom left corner of the gnuplot window where it would normally report where on the (x,y) axis your mouse is currently at, it is reporting my x-axis in scientific notation.

For example, instead of stating that my mouse is at (33:10,20%) it is reporting that it is as (5.10770e+08,20%) <--Random scientific notation). I have already set the timefmt and xdata, so I am confused at to what I am missing in order to properly report the data. If someone could please help it would be greatly appreciated.

I have searched on superuser and Unix/Linux, and this question seems to fit on Stackoverflow the best as gnuplot has its own scripting language. Also if you look at the gnuplot tag on the various sites, gnuplot fits more on stackoverflow and has thousands of more tags compared to 30 and 67.

I have also viewed Turn Off Scientific Notation In Gnuplot and tried to implement the answer here (Christoph is the GNUPLOT man!), but have thus far been unable to configure it to work properly (it still displays the scientific notation).

gnuplot -e persist "set title 'Resource monitor' ; set timefmt '%y/%m/%d-%H:%M:%S' ; set xdata time ; set xlabel 'TIME' ; set ylabel 'PERCENT' set yrange [0:101]" -e "plot '${cpuResFile}' using 1:2 title 'CPU' smooth Bezier, '${memResFile}' using 1:2 title 'MEM' smooth Bezier ; pause -1"

Solution

  • You're in the right place to ask for gnuplot help!

    I've tried this on x11 and wxt, don't know other interactive terminals.

    You can switch between different mouse statusbar formats by pressing 1 (2 cycle backwards)

    Fore more help on interactivity, press h and you'll get a list ho keyboard shortcuts

    Some information is on help mouse format

    To change it programmatically with the corresponding command set mouse format (but I didn't manage to display properly date/time...)