Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.graphics.apps.gnuplot > #996 > unrolled thread
| Started by | Tilman Schröder <tilman.schroeder@gmx.de> |
|---|---|
| First post | 2012-03-25 16:29 +0200 |
| Last post | 2012-03-25 15:14 -0700 |
| Articles | 4 — 2 participants |
Back to article view | Back to comp.graphics.apps.gnuplot
make gnuplot ignore string length Tilman Schröder <tilman.schroeder@gmx.de> - 2012-03-25 16:29 +0200
Re: make gnuplot ignore string length sfeam <sfeam@users.sourceforge.net> - 2012-03-25 10:14 -0700
Re: make gnuplot ignore string length Tilman Schröder <tilman.schroeder@gmx.de> - 2012-03-25 20:28 +0200
Re: make gnuplot ignore string length sfeam <sfeam@users.sourceforge.net> - 2012-03-25 15:14 -0700
| From | Tilman Schröder <tilman.schroeder@gmx.de> |
|---|---|
| Date | 2012-03-25 16:29 +0200 |
| Subject | make gnuplot ignore string length |
| Message-ID | <jkna42$pec$1@news.albasani.net> |
Heyho everyone, I am using gnuplot to generate svgs with text fields containing latex commands. This works quite fine for x/ytics and x/ylabels, but not for keys/the legend. For one plot, I need to have the keys outside the graph area (below), but since the titles contain lots of latex commands, gnuplot only prints one of three titles in the legend because it thinks all three titles won't fit in there. Is there a way to tell gnuplot not to use the string length, but instead just put the titles where they should be, ignoring the fact that they might be overlapping? Using enhanced mode to reduce the title's font size is not an option since backslash processing in enhanced mode is broken ... Thanks in advance, bye, Tilman
[toc] | [next] | [standalone]
| From | sfeam <sfeam@users.sourceforge.net> |
|---|---|
| Date | 2012-03-25 10:14 -0700 |
| Message-ID | <jknjpe$r7$1@dont-email.me> |
| In reply to | #996 |
Tilman Schröder wrote:
> Heyho everyone,
>
> I am using gnuplot to generate svgs with text fields containing latex
> commands.
svg + latex? That's a combination I have not encountered.
Is there such a thing as an svg viewer that understands latex?
Are there problems with latex syntax using characters that
must be escaped before use in xml/svg documents?
> This works quite fine for x/ytics and x/ylabels, but not for keys/the
> legend.
>
> For one plot, I need to have the keys outside the graph area (below),
> but since the titles contain lots of latex commands, gnuplot only
> prints one of three titles in the legend because it thinks all three
> titles won't fit in there.
>
> Is there a way to tell gnuplot not to use the string length, but
> instead just put the titles where they should be, ignoring the fact
> that they might be overlapping?
There would seem to be an inherent contradiction between having the
program "ignore the length" and still having it know
"where they should be".
Possibly you can manually correct for the problem by using the command
set key width -XX
where XX is the approximate length of the unprocessed LaTeX string.
Note that the correction is a negative number.
You might have to further force the layout using, e.g.
set key maxcolumns 1
or set key maxrows 1
as the case may be.
Ethan
[toc] | [prev] | [next] | [standalone]
| From | Tilman Schröder <tilman.schroeder@gmx.de> |
|---|---|
| Date | 2012-03-25 20:28 +0200 |
| Message-ID | <jkno3h$srs$1@news.albasani.net> |
| In reply to | #997 |
Heyho,
Am 25.03.2012 19:14, schrieb sfeam:
> Tilman Schröder wrote:
>
>> Heyho everyone,
>>
>> I am using gnuplot to generate svgs with text fields containing latex
>> commands.
>
> svg + latex? That's a combination I have not encountered.
> Is there such a thing as an svg viewer that understands latex?
> Are there problems with latex syntax using characters that
> must be escaped before use in xml/svg documents?
There is an "Export to PDF with Latex" option in recent versions of
Inkscape (starting with 0.48), that exports all drawings and paths as a
pdf and that generates a latex file which includes this pdf and which
does the typesetting of all text in the original svg. This way, I can
write something like $\frac{a}{b}$ in inkscape which will interpreted by
latex. Text is placed on the base point of the text field. See
http://mirror.ctan.org/info/svg-inkscape/InkscapePDFLaTeX.pdf
This way, I change some macro definition in my preamble and on
recompile, about 30 diagrams are updated automatically.
By the way: Yes, Inkscape "understands" latex. You can use latex to
render some formula and then it automatically imports this as a path
into your svg drawing. This is some Inkscape plugin, but I do not use it.
There are no problems with escaping characters as long as enhanced mode
is switched off. There is a bug in processing the double backslash and
other characters, see
http://sourceforge.net/tracker/?func=detail&aid=3496517&group_id=2055&atid=302055
I did not file it as a bug report (yet), as I do not have much time
until friday ...
>> This works quite fine for x/ytics and x/ylabels, but not for keys/the
>> legend.
>>
>> For one plot, I need to have the keys outside the graph area (below),
>> but since the titles contain lots of latex commands, gnuplot only
>> prints one of three titles in the legend because it thinks all three
>> titles won't fit in there.
>>
>> Is there a way to tell gnuplot not to use the string length, but
>> instead just put the titles where they should be, ignoring the fact
>> that they might be overlapping?
>
> There would seem to be an inherent contradiction between having the
> program "ignore the length" and still having it know
> "where they should be".
Well, yes and no. Where it should be implies that the strings should not
overlap in the ouput (svg). This is not true for my case: I have very
long latex commands which collapse to a short formula upon compilation.
I was thinking about some "just space it evenly". Example: 6 keys,
below, vertical, maxrows 2, reverse, Left -> 3 columns, equally wide,
colored line on the left of the column, text after that, left justified.
It does not matter wether the text in the first column is so long that
it reaches into the middle and the last column, they are all evenly
spaced ...
I know this is not what you were thinking of when developing this
program ...
> Possibly you can manually correct for the problem by using the command
> set key width -XX
> where XX is the approximate length of the unprocessed LaTeX string.
> Note that the correction is a negative number.
> You might have to further force the layout using, e.g.
> set key maxcolumns 1
> or set key maxrows 1
> as the case may be.
>
> Ethan
I will not try this as I found a solution: Putting the keys in one
column inside the graph area for this single plot. This works as there
is some space, but in other plots which have to have exactely the same
size (this is why I love this program) there is no space within the
graph area so I have to place the keys below.
However, thank you for your tips.
Bye,
Tilman
[toc] | [prev] | [next] | [standalone]
| From | sfeam <sfeam@users.sourceforge.net> |
|---|---|
| Date | 2012-03-25 15:14 -0700 |
| Message-ID | <jko5bl$cob$1@dont-email.me> |
| In reply to | #998 |
Tilman Schröder wrote: > By the way: Yes, Inkscape "understands" latex. You can use latex to > render some formula and then it automatically imports this as a path > into your svg drawing. This is some Inkscape plugin, but I do not use > it. I do use inkscape, but I didn't know about that option. I'll have to keep it in mind. > There are no problems with escaping characters as long as enhanced > mode is switched off. There is a bug in processing the double > backslash and other characters, see > http://sourceforge.net/tracker/?func=detail&aid=3496517&group_id=2055&atid=302055 > I did not file it as a bug report (yet), as I do not have much time > until friday ... Yes, there's a bug. Unfortunately the patch on the tracker is not sufficient to fix it. I initially thought there must be an easy fix, but it turns out to be quite complicated. In part this is because individual terminal drivers choose to send individual text fragments either through the enhanced text processing or the normal text output based on what characters appear in the string. That means they will now have to pay more attention to backslashes before making this decision, and all the various terminals will need to be checked to make sure they are consistent. > I was thinking about some "just space it evenly". > Example: 6 keys, below, vertical, maxrows 2, reverse, Left -> 3 > columns, equally wide, colored line on the left of the column, text > after that, left justified. It does not matter wether the text in the > first column is so long that it reaches into the middle and the last > column, they are all evenly spaced ... That sounds reasonable. Ethan
[toc] | [prev] | [standalone]
Back to top | Article view | comp.graphics.apps.gnuplot
csiph-web