my buddy Peter Hedwig has written a terminal for gnuplot which allows
interfacing with Lua, a nice and easy and FAST scripting language with open
source interpreter.
http://www.lua.org/
This is interesting for me (and maybe for some of you, too) as in the
current configuration it uses Lua to write a TeX source file with
PGF/Tikz-instructions which can then be included in LaTeX documents (it is
trivial though to use a different lua script which might render a
completely different output format).
?WTF?? you might ask. And you are right in doing so if you have never heard
of Pgf/Tikz. The usefulness of this becomes clear immediately to people who
dislike how their gnuplot plots look when imported as bitmap into a LaTeX
document. The fonts aren?t right, lines look wishy-washy, etc. And even if
you do get these right, once you change the fonts in your document you have
to redo all plots. The gnuplot-lua-terminal solves these issues by using
PGF/Tikz. PGF/Tikz is a drawing library for LaTeX. Simply put, your gnuplot
plot is translated into a list of LaTeX commands which make sure to use the
right fonts, line widths, etc., to achieve a seamless fit into your LaTeX
document.
Download it here
<http://peter.affenbande.org/gnuplot/>
MINI-HOWTO:
start gnuplot
set term lua fulldoc
set output ?test.tex?
plot (x**2)
plot (x**3)
Then in the terminal run:
pdflatex test.tex
and then use some pdf viewer to look at the result. The default settings of
the Lua terminal create a tex file without preamble, etc, so you can
include it in your document. With the ?fulldoc? option we get a complete
LaTeX source including preambel, etc.. Have a look at the included
documentation for more info.
EXAMPLE:
Here you can find an example output.
<http://peter.affenbande.org/gnuplot/gnuplot_lua_terminal/test.pdf>
Regards,
Flo
--
Palimm Palimm!
http://tapas.affenbande.org
Unicode oh unicode!!
> ?WTF?? you might ask. And you are right in doing so if you have never
"WTF"
> heard of Pgf/Tikz. The usefulness of this becomes clear immediately to
> people who dislike how their gnuplot plots look when imported as bitmap
> into a LaTeX document. The fonts aren?t right, lines look wishy-washy,
[snip]
> MINI-HOWTO:
>
> start gnuplot
>
> set term lua fulldoc
> set output ?test.tex?
set output "test.tex"
> plot (x**2)
> plot (x**3)
>
> Then in the terminal run:
>
> pdflatex test.tex
[snip]
Hi Florian,
I'm wondering why don't you use the ability of gnuplot to produce EPS
files which can be perfectly integrated into LaTeX documents...
without the drawbacks of non-vector images that you mentioned.
Stefan
> I'm wondering why don't you use the ability of gnuplot to produce EPS
> files which can be perfectly integrated into LaTeX documents...
> without the drawbacks of non-vector images that you mentioned.
Oh well, since Peter is quite shy, i'll try to answer to my best ability:
With the eps approach you don't get global styles for controlling all
aspects of the plots which you do get with the lua/Tikz/PGF approach...
You can change the size of the plot and the width of all lines, for example,
stay the same size.. The approach via Pgf/Tikz is extremely flexible.. As
another example you can, for instance, get the bounding box of the plot and
use relative positions to produce overlays, etc.. (erm, relative is the
wrong word :) use numbers between 0 and 1 and simply scale with the
width/height of the plot and the overlay will magically appear at the right
position even if you rescale the plot). You can layer Pgf graphics. And all
other kinds of goodies.
Regards,