From: Hans-Bernhard B. <br...@ph...> - 2004-07-03 19:01:42
|
On Sat, 3 Jul 2004, Harald Harders wrote: > There is one problem with logarithmic axes: It is difficult to handle > offsets given in plot coordinates (`first', `second') with log axes. > Hans-Bernhard has suggested to use the coordinates as factors then. > `offset first 2,2' could mean to put the text to the position with double > value of the default position. This sounds good to me. While at it, let's also note that vaguely similar problems exist with relative positions on time/date axes. It's surprisingly hard to predict what 'set xtics' & friends will do if you specify the tic step size explicitly. There's another precedent to be kept in mind: the 'rto' way of specifying arrow endpoints relative to their starts instead of absolutely. All such usages of relative positions and offsets had better have a consistent user interface. E.g. 'rto' could be renamed to 'to offset'. > - Which kind of interface do you think is best, I like the idea you've presented. 'offset' tells the reader of the command exactly what it does, and it should be easy to memorize. > and shall all kinds of text output have the `offset' functionality? Definitely. > - How shall this new function be implemented? Which function and which > struct are to be extended? Wrap both term->put_text() and write_multiline() into new functions, term_offset_text() and write_multiline_offset that call the basic functions with the appropriate changes to the position. Which reminds me of another project that feels overdue: splitting term.c into (at least) 3 parts: routines called by *.trm functions (e.g. do_point(), do_arrow()); wrappers around term->foo() functions serving as a buffer layer between them and the main core of gnuplot, and a .c file whose sole job it is to #include "term.h". Effectively, we may end up renaming term.h to a .c file... The new "output text with positional offset" functions would go into the second of those parts. -- Hans-Bernhard Broeker (br...@ph...) Even if all the snow were burnt, ashes would remain. |