|
From: Robert H. <en...@no...> - 2005-03-14 17:03:15
|
Is there any plans to improve the method of estimating the width of text
strings for pslatex plots?
e.g something like:
set format y '[r]{%.0t$\times$10$^{%+03T}$}'
ends up with a huge gap between the border of the plot and yaxis label
because gnuplot assumes the tic labels are much bigger than the actually
are.
I think the only real way of getting the length of a text string would
be to run it through LaTeX, and that isn't really feasible, but I think
a much better estimate of the length of the string could be got by
neglecting "{}$^_" and counting "\somecommand" as one character (i.e.
assuming it produces a single symbol).
Is this something that could fit into the existing enhanced text support
(used by other terminals). Or would the terminal drivers need to be
extended with an optional "strlen" function?
Rob
--
Robert Hart <en...@no...>
University of Nottingham
This message has been checked for viruses but the contents of an attachment
may still contain software viruses, which could damage your computer system:
you are advised to perform your own checks. Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.
|
|
From: Ethan M. <merritt@u.washington.edu> - 2005-03-14 17:22:50
|
On Monday 14 March 2005 09:02 am, Robert Hart wrote: > Is there any plans to improve the method of estimating the width of text > strings for pslatex plots? No. > Is this something that could fit into the existing enhanced text support > (used by other terminals). Or would the terminal drivers need to be > extended with an optional "strlen" function? There is a new dummy driver in the current cvs version called "estimate.trm" that is used internally to do exactly what you want for strings using gnuplot's own enhanced text mode. But that is not going to get you a full TeX interpreter inside gnuplot. -- Ethan A Merritt merritt@u.washington.edu Biomolecular Structure Center Mailstop 357742 University of Washington, Seattle, WA 98195 |
|
From: Robert H. <en...@no...> - 2005-03-14 17:45:31
|
On Mon, 2005-03-14 at 09:22 -0800, Ethan Merritt wrote: > On Monday 14 March 2005 09:02 am, Robert Hart wrote: > > Is this something that could fit into the existing enhanced text support > > (used by other terminals). Or would the terminal drivers need to be > > extended with an optional "strlen" function? > > There is a new dummy driver in the current cvs version called > "estimate.trm" that is used internally to do exactly what you > want for strings using gnuplot's own enhanced text mode. > > But that is not going to get you a full TeX interpreter inside > gnuplot. so, in principle, if I added an "enhanced" mode to the pslatex driver, it would be able to give gnuplot an *estimate* of the length of a latex fragment, but actually just output the text in an unenhanced way? or is it going to cause problems if an enhanced mode terminal doesn't use enhanced mode syntax? The enhanced mode functions don't seem to be documented in term/README Rob -- Robert Hart <en...@no...> University of Nottingham This message has been checked for viruses but the contents of an attachment may still contain software viruses, which could damage your computer system: you are advised to perform your own checks. Email communications with the University of Nottingham may be monitored as permitted by UK legislation. |
|
From: Ethan M. <merritt@u.washington.edu> - 2005-03-14 18:20:17
|
On Monday 14 March 2005 09:45 am, Robert Hart wrote: > On Mon, 2005-03-14 at 09:22 -0800, Ethan Merritt wrote: > > There is a new dummy driver in the current cvs version called > > "estimate.trm" that is used internally to do exactly what you > > want for strings using gnuplot's own enhanced text mode. > > > > But that is not going to get you a full TeX interpreter inside > > gnuplot. > > so, in principle, if I added an "enhanced" mode to the pslatex driver, > it would be able to give gnuplot an *estimate* of the length of a latex > fragment, but actually just output the text in an unenhanced way? I don't think so. gnuplot's enhanced text mode has its own syntax and conventions, and they are not the same as TeX/LaTeX. So I'm pretty sure feeding a TeX command string to gnuplot's enhanced text parser will not produce useful information. > The enhanced mode functions don't seem to be documented in term/README The enhanced text mode was originally part of the postscript driver (only). It was later extended to apply to other drivers as well. But the basic documentation files are still hiding in .../docs/psdoc/ They should probably move to a more general location. If you were looking for specific details of the driver entry points used by enhanced text mode, that's another story. The implementation in dumb.trm was intended as a simplest-case example of how to add support to a new driver. Beyond that simplest case, however, each terminal type is a bit different in its needs. hope that helps -- Ethan A Merritt merritt@u.washington.edu Biomolecular Structure Center Mailstop 357742 University of Washington, Seattle, WA 98195 |
|
From: Hans-Bernhard B. <br...@ph...> - 2005-03-14 17:34:03
|
Robert Hart wrote:
> set format y '[r]{%.0t$\times$10$^{%+03T}$}'
> ends up with a huge gap between the border of the plot and yaxis label
> because gnuplot assumes the tic labels are much bigger than the actually
> are.
And you have command like 'set lmargin' for the express reason that they
enable you to work around that misfeature.
|
|
From: Robert H. <en...@no...> - 2005-03-14 18:07:24
|
On Mon, 2005-03-14 at 18:37 +0100, Hans-Bernhard Broeker wrote:
> Robert Hart wrote:
>
> > set format y '[r]{%.0t$\times$10$^{%+03T}$}'
> > ends up with a huge gap between the border of the plot and yaxis label
> > because gnuplot assumes the tic labels are much bigger than the actually
> > are.
>
> And you have command like 'set lmargin' for the express reason that they
> enable you to work around that misfeature.
This I am aware of. These workarounds are difficult to find for novice
users and inconsistently implemented (e.g "set lmargin" completely
overrides the calculated width, but "set key width" and "set ylabel
offset" require a number of charwidths to add or remove)
At very least, the terminal help should mention the possible need for
these commands, but I would have thought a better estimate of the length
would eliminate the need for them in the majority of cases.
--
Robert Hart <en...@no...>
University of Nottingham
This message has been checked for viruses but the contents of an attachment
may still contain software viruses, which could damage your computer system:
you are advised to perform your own checks. Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.
|