Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.graphics.apps.gnuplot > #998

Re: make gnuplot ignore string length

From Tilman Schröder <tilman.schroeder@gmx.de>
Newsgroups comp.graphics.apps.gnuplot
Subject Re: make gnuplot ignore string length
Date 2012-03-25 20:28 +0200
Organization albasani.net
Message-ID <jkno3h$srs$1@news.albasani.net> (permalink)
References <jkna42$pec$1@news.albasani.net> <jknjpe$r7$1@dont-email.me>

Show all headers | View raw


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

Back to comp.graphics.apps.gnuplot | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

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

csiph-web