1 2Gnuplot PGF/TikZ terminal 3========================= 4 5The PGF/TikZ terminal mainly consists of a generic Lua terminal to 6wrap the gnuplot terminal C functions. This allows writing gnuplot 7terminals in Lua instead of C. The first implemented `backend' is the 8PGF/TikZ terminal for the use with TeX/LaTeX. 9 10The actual terminal functionality is a provided by a separate Lua script 11`gnuplot-tikz.lua'. The LaTeX style file is usually derived from the 12PGF/TikZ terminal script to keep things consistent. 13 14 15 16Why all that hassle? 17==================== 18 19There are already a couple of terminals usable for LaTeX so why another one? 20 21Here is a brief list of reasons: 22 23 1. I like PGF/TikZ and there is no such terminal so far. 24 2. I also like lerning Lua and the use of Lua makes this terminal 25 very versatile, e.g. there is no recompilation necessary if 26 you want to change/add any terminal features and you also gain 27 all the benefits of using a scripting language in this 28 place -- whatever that means to you ;-) 29 3. Most advantages are directly related to PGF/TikZ: 30 a. rescaling the plot does not automatically change the linewidths 31 nor the size of points (aka plot marks), fonts, arrow tips or 32 fill patterns. The aspect ratio of these elements will also 33 remain unchanged on unproportional scalings. 34 b. you can directly produce documents of any output format 35 that is supported by PGF/TikZ. 36 c. changing the appearance of the plots is an easy task even 37 after the generation of the PGF/TikZ code. This can be done 38 locally or globally by changing certain TikZ-styles or 39 dimensions. 40 d. it is also easy to put the keys (aka legend) into the normal text 41 area (e.g. the plot caption), because the line and plotmark styles 42 are available. 43 e. overlaying of the plot with e.g. additional nodes, arrows etc. is 44 possible through the use the of tikz coordinates of the actual 45 plotting area. 46 47For more reasons please have a look at the PGF/TikZ manual ;-) 48 49 50 51Generating style and help file 52============================== 53 54To generate the style files and wrapper for the various TeX flavors enter 55 56 lua gnuplot-tikz.lua style 57 58on the command line. The files generated should be 59 60 t-gnuplot-lua-tikz.tex (Context wrapper) 61 gnuplot-lua-tikz.tex (plain TeX wrapper) 62 gnuplot-lua-tikz.sty (LaTeX wrapper) 63 gnuplot-lua-tikz-common.tex (common definitions) 64 65and can be copied to the appropriate places. 66 67 lua gnuplot-tikz.lua help 68 69prints the terminal help on stdout and 70 71 lua gnuplot-tikz.lua termhelp > gnuplot-tikz.help 72 73generates the version to be included in gnuplot help system. 74 75 76 77Usage 78===== 79 80The usage is quite similar to the other terminals with the difference that 81most terminal options are processed by the external Lua script. To see the 82list of additional script options just type 83 gnuplot> set term lua tikz help 84or 85 # lua gnuplot-tikz.lua 86on the command line. 87 88 89A minimalist gnuplot session (or script) may look like this: 90 91> set term lua tikz # activate the Lua terminal and load "gnuplot.lua" 92> set out 'test.tex' # write output to file 'test.tex' 93> plot x*x # plot a nice parabola 94 95The generated file `test.tex' can be used by simply adding the line 96 97 \input{test.tex} 98 99to your LaTeX document and by adding 100 101 \usepackage{gnuplot-lua-tikz} 102 103to the preamble. 104 105 106 107 108 109Any comments, suggestions and bug reports are most welcome and can go 110to <peter(at)affenbande.org> or the Sourceforge bug and patch trackers. 111 112Have fun! 113 114Peter Hedwig <peter@affenbande.org> 115