Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#1153 Canvas terminal with epoch time loses axis edges precision

5.0
closed-fixed
nobody
2D plot (258)
5
2013-03-01
2012-07-26
Petteri Tolonen
No

When using canvas terminal to plot data with epoch time (timefmt '%s'), there's an offset in the mouse coordinates printed by javascript. This is because gnuplot for some reason outputs the values of gnuplot.plot_axis_xmin and gnuplot.plot_axis_xmax in exponential format and some precision of epochs is lost. I'm using Ubuntu 12.4 and gnuplot 4.6.0 from Ubuntu Quantal repository.

A demonstration of the problem is enclosed and it includes the following files:
test.gp - The gnuplot script used to generate index.html (html+javascript)
test.dat - Test data is CSV data generated by CollectD monitoring system. First column is the epoch and first on the first row are the headers. The values represent load values on one computer.
js/* - The gnuplot files from /usr/share/gnuplot/4.6/gnuplot/gnuplot/js/ (on Ubuntu 12.4)

How to demonstrate:
- extract the package to some directory
- run: "gnuplot test.gp" to generate index.html on the same directory
- open the index.html with some modern browser
- move the mouse on the plot and see that the time on the coordinate box left of the plot differs from the time on x-axis tics

My result can be viewed here:
http://www.cs.tut.fi/~tolonen6/gnuplot/index.html

Discussion

  • Demonstration files

     
  • Ethan Merritt
    Ethan Merritt
    2012-08-01

    fixes X axis time precision for mouseable canvas, svg terminals

     
    Attachments
  • Ethan Merritt
    Ethan Merritt
    2012-08-01

    Thank you for the analysis and the bug report.
    The attached patch is against 4.7 but should also work for 4.6.
    Some version of it will be added to cvs for the next release.

     
  • Ethan Merritt
    Ethan Merritt
    2012-08-01

    • status: open --> pending-fixed
     
  • Ethan Merritt
    Ethan Merritt
    2013-03-01

    • status: pending-fixed --> closed-fixed
    • milestone: --> 5.0