From: Ethan M. <merritt@u.washington.edu> - 2004-04-02 16:58:28
|
On Friday 02 April 2004 01:30 am, Giuseppe G. N. Angilella wrote: > Mmm. That does not work with keys, at least, e.g. with > > set term post enh > set out 't.ps' > plot x t "first line\nsecond line" > > (It does work with set label, on the contrary, as is indeed explained in > help syntax.) > > Is that a bug? Let's call it a "design decision" rather than a bug. The key box layout is calculated, and space is reserved for it, before any of the plots are actually generated. The routine that does this size calculation doesn't know exactly what is going to be printed for each plot title, so it only reserves one line per plot. Consistent with this, when it is time to actually print out the plot key title gnuplot calls term->put_text directly rather than calling write_multiline(). Because of this, newline characters are not expanded into actual line breaks. If you were to call write_multiline() instead, the first title would indeed span multiple lines. But then the next title printed would be placed right on top of the second line of your first title, which is no good. If we were to allow multi-line plot key entries, we would have to totally re-write the key generation code. That would be a very large task, although if someone wants a gnuplot development project to work on that is a good candidate. The key generation code has built up into a horrible tangle, and starting over could potentially make it much cleaner and extensible. -- Ethan A Merritt merritt@u.washington.edu Biomolecular Structure Center Mailstop 357742 University of Washington, Seattle, WA 98195 |