|
From: sfeam <sf...@us...> - 2014-10-05 17:04:09
|
On Sunday, 05 October 2014 05:22:22 PM Karl Ratzsch wrote: > Am 05.10.2014 15:27, schrieb Karl Ratzsch: > > i just checked out the latest 5.1 cvs, and it seems to work just nicely. > > > > One more : > > Coordinates given for e.g. "set arrow" still need "xdata time": > > set timefmt "%H:%M:%S" > set arrow 1 from "12:31:01.4",10 to "12:31:01.7",35 Yes, because all positional coordinates are treated as "input" rather than "output". So axis ranges, objects, labels, etc all use xdata+timefmt rather than xtics+format. That's the way it has always been. I don't see a strong argument for changing it. No matter what you choose it's going to be at least a bit confusing. And really it does make sense. That's the format the time coordinates would require if the vector endpoints were being plotted from a data file. Shouldn't the coordinate format be the same regardless of whether the endpoints come from a file or from the command line? > This is alright for backward compatibility, however the new syntax > cannot decide if a string is just a numeral stored as a string variable > or a timestring that needs to be interpreted according to the format > string set by "set timefmt". ?? I'm not following you there. I thought that the behavior has always been, and continues to be, that a bare number was treated as numerical seconds while a string was fed through strptime. A numeral stored as a string also works, so long as timefmt contains "%s". I might have broken this for some particular case, but I did test it for labels and axis ranges. Do you have an example of breakage? > To resolve this, i propose to give the function strptime() a default > format e.g. -1 which refers to the momentary "set timefmt" setting. > > set arrow 1 from strptime(-1,"12:31:01.4"),10 \ > to strptime(-1,"12:31:01.7"),35 > > For actual use, the doc can then suggest defining a function > > TSx(timestr) = strptime(-1,timestr) > > to save typing. Might as well just do the save for strptime as I did for timecolumn, change it internally to accept a variable number of parameters. 1 parameter means "use default timefmt". 2 parameters means "use the time format in parameter 1". But I don't think this is needed. > P.S. Should there be a threat about a possible future removal of "set > xdata time" in the docs? Perhaps not. The underlying input/output > problem should be resolved, and for people who plot a lot of time scales > it is just quite convenient. "set xdata time" is still needed in order to control input data parsing. The recent changes only affect how the tic labels and mouse coord readout are handled on output. The input processing remains the same as before unless I inadvertently broke something. Ethan |