|
From: Ethan A M. <sf...@us...> - 2014-10-02 17:55:54
|
On Thursday, 02 October, 2014 14:57:15 Karl Ratzsch wrote: > > With the new version of the timecolumn() function now including a format > string, i think it is time to deprecate the use of the "set xdata time" > / "set timefmt" combination, > the former influencing inconveniently both input and output. I agree that it would be worth re-thinking these commands. > This would technically (as I see) only need a new option "time" to "set > xtics" so the interpretation of the output format string can be > controlled without "set xdata time". It's more complicated than that. For one thing, the desire for time formats is not limited to axis labeling, and even when labeling an axis it does not follow that "time" is the same thing as "date". See for example https://sourceforge.net/p/gnuplot/feature-requests/392/ which points out that it's really annoying if a quantity that represents elapsed time is treated as a date rather than simply some number of days+hours+minutes+seconds. In that particular use case the quantity is a vector length, not an axis coordinate per se, so "set xtics time" would not really fill the need. Yes the x coordinate is a date, but the vector length is elapsed time - two different formats are required. > Worst part of this would probably be rewriting a lot of documentation, > for which i´d volunteer. Do this for gp50? It turns out the current documentation for "set timefmt" is simply wrong (left over from version 4.4 I guess). I did a quick re-write yesterday for inclusion in v5, but yes it would be nice to have a more comprehensive revision, better yet if it comes with examples or demos. > The technical change would be backward-compatible, but changes of > recommended syntax should probably not happen at minor releases. Input ===== We already broke some backwards compatibility by adding a 2nd parameter to timecolumn(). The new version obviates the need for "set xdata time" to handle input, although arguably it is uglier to put the information in the "using" part of every plot command rather than setting it only once via "set xdata time; set timefmt x 'foo'". Output ====== I think this is actually the messier part. timecolumn() can be used to differentiate individual columns on input, or for that matter different formats in different input files on the same plot. But we have no corresponding mechanism for writing out times that are not dates. Not for axis tic labels and certainly not for arbitrary columns written by "set table" or "plot .... with table". Your suggestion for a "set xtics time 'timefmt'" would partially address this. But I think we would want to distinguish set xtics {time|date|numeric|geographic|other?} And we would still need some additional way to control tabuler output. Other issues ================= That leaves the problem that "set xdata time; set timefmt foo" is used to interpret axis ranges as well as input data. This is IMHO completely confusing already, since it doesn't match what is used to actually label the axis ("set format x"). I don't have a good suggestion on how to fix this. Related to that, I think that mousing readout and zoom also depend on "set xdata". V5 supports geographic coordinates (degrees minutes seconds) for axis labels, but not for data input. I.e. "set xdata geographic" affects only the output side. So it would go naturally into a revised "set xtics" command and could be removed as an option to "set xdata" since it was never in v4. Ethan |