|
From: <pl...@pi...> - 2012-04-25 08:24:57
|
On 04/24/12 23:47, Ethan A Merritt wrote: >> One more thing while you're around, I have xdata as timedata and the >> mouse annotation feature is outputting a rather lengthy x coord. >> >> Sat 01, Jan 2000 16:03:47 GMT >> >> My graph runs 0:00 to 22:00 so the data part is spurious any way. >> a) Is there a way to set this format >> b) this is a bug since the date is spurious. >> > > I'll start by saying that I know almost nothing about date handling in > various javascript interpreters. Gnuplot is just putting out raw seconds; > the conversion from "epoch seconds" to Time/Date is done by the javascript > engine. So if yours is producing the wrong date I have no clue where to > set about fixing it. > > Anyhow, the supported options are limited to requesting it to print > only the Date, only the Time, or both (default), using > set mouse mouseformat "Date" > set mouse mouseformat "Time" > set mouse mouseformat "DateTime" > > If you consistently want some other format, I'm afraid you're on > your own to modify the javascript code in gnuplot_svg.js. > > In general it would be great if there were a way to translate the > coordinate output formats (dates or otherwise) from gnuplot's own > C-like format to something usable in javascript so that the svg > and canvas terminals could use it. But I failed to find any such > C -> javascript conversion library that could be linked to for > this purpose. > > Ethan >> from the console this system displays the following format (and knows >> what day it is ;) ) >> #date >> Tue Apr 24 21:24:04 UTC 2012 >> >> regards. >> > Thanks, I'd see the DATE TiME thing in the source but had not found out how to set it. Looks just the ticket. Perhaps the current default is not the most logical choice. I would have thought that what has been chosen for the graph would be the obvious default for the label and the live coord read out , both in interactive and js context. In this case I have set timefmt "%H:%M:%S" set format x "%02Hh%02M" Now timefmt is what is required by the *input* data , not the graph output. Never the less this is what is provided with an integer arg of 3 Similarly an argument of 5 will get me a simple hh:mm format which may or may not be the same as my displayed x coord. In this case not. help states: The following formats are available: 0 default (same as 1) 1 axis coordinates 1.23, 2.45 This is wrong. Neither 0 nor 1 display what I have on the axis coordinates . In fact if I select "1" I get a decidedly unhelpful 15032.4 instead of a legible time coord. I would suggest that if xdata = time then mouse should be using this. If format x is set this should be used rather than timefmt (which is the default x format, not the actual one). In summary default mouse format should be what is displayed on the graph, taking into account any setting used in created it. In an interactive terminal, I guess any later changes to format specifiers would change mouse behaviour. That is up to the use. Perhaps this is what was originally intended since it seems odd having both 0 and 1 do the same. Thanks for your help. I think this should do just what I want with an explicit option rather than the default. Best regards, Peter. |