But here is how it works:
Usage
set terminal lua tikz standalone
set output "test.tex"
plot sin(x)
standalone/nostandalone/fulldoc
Compiling
> pdflatex test.tex
immediate compiling only works as far as I saw for standalone and fulldoc set terminal lua tikz standalone
set output "test.tex"
plot sin(x)
> pdflatex test.tex
immediate compiling only works as far as I saw for standalone and fulldocif (<condition>) <command-line> [; else if (<condition>) ...; else ...]commands are just written after if condition
if (<condition>) { <command>; <command>
<commands>
<commands>
} else {
<commands>
}
Commands enclosed in curly brackets.test eq "test"
set key top left
top/bottom/centerleft/right set key Left
Left or Right (Default) set key reverse ## reverse text and sample
set key samplen <length> ## change length of samplen
set key spacing <spacing> ## set spacing between key lines
load "gnuplot-setup"
plot sin(x)
eval latexterm("test","6cm","4cm","",'\n\\renewcommand\{\\normalsize\}\{\\fontsize\{24.88\}\{30\}\\selectfont\}')
set terminal epslatex header "
\\renewcommand\{\\normalsize\}\{\\fontsize\{24.88\}\{30\}\\selectfont\}
"
convert -density 300 -depth 8 -rotate -90 -quality 85 test.pdf test.png
composite -verbose -geometry 15%x15%+700+00 inset.png background.png test.png
load "/folder/of/your/gnuplot/script/script.gnu"
#--- LINESTYLES-------------------------------------------------------
set style line 1 lt 1 lc rgb "black" pt 2 lw 2.0
set style line 2 lt 1 lc rgb "red" pt 4 lw 2.0
set style line 3 lt 1 lc rgb "blue" pt 6 lw 2.0
set style line 4 lt 1 lc rgb "#44AA44" pt 8 lw 2.0
set style line 5 lt 1 lc rgb "#cc7722" pt 10 lw 2.0
set style line 6 lt 1 lc rgb "#BBBBBB" pt 12 lw 2.0
plot sin(x) ls 1
#--- bash("command") -------------------------------------------------
# -allows to use bash commands in gnuplot
bash(cmd) = sprintf('set print "| /bin/bash"; print "%s"; set print', cmd)
eval bash("echo test")
#--- latexterm("name", "xsize", "ysize","command","latexcommand")--\
----------------------------
# -sets terminal to epslatex and creates output file with xsize and\
ysize
latexterm(name, xsize, ysize, command,latexcommand) = sprintf('\
name="%s";\
xsize="%s";\
ysize="%s";\
command="%s";\
latexcommand="%s";\
set terminal epslatex size xsize, ysize color colortext standalone \
header "\\usepackage[T1]{fontenc}\n\\usepackage{mathptmx}\n\\usepackage{helvet} ".latexcommand command ; \
set output name.".tex"; \
replot; \
unset output;\
eval bash("latex ".name.".tex"); \
eval bash("dvips ".name.".dvi"); \
eval bash("ps2pdfbb ".name.".ps"); \
eval bash("rm -rf ".name.".aux ".name.".dvi ".name.".log ".name.".ps ".name.".tex ".name."-inc.eps"); \
set terminal wxt; \
',name,xsize,ysize,command,latexcommand)
eval latexterm("test","6cm","4cm","","")
#--- fitcube("plotinfo", "n")-----------------------------------------
# -fits a cubic function to the data plotinfo with the name "n"
fitcube(plotinfo,n) = sprintf('\
%s(x)=a%s*x**3+b%s*x**2+c%s*x+d%s;\
fit %s(x) %s via a%s,b%s,c%s,d%s;\
print "fitted function is saved in %s(x): \
%s(x)=",a%s,"x**3 + ",b%s,"x**2 + ",c%s,"*x + ",d%s;\
eval bash("rm -f fit.log");\
x1%s =(-2*b%s-sqrt(4*b%s**2-12*a%s*c%s))/(6*a%s);\
x2%s =(-2*b%s+sqrt(4*b%s**2-12*a%s*c%s))/(6*a%s);\
y1%s =%s(x1%s);\
y2%s =%s(x2%s);\
print "extreme points at (",x1%s ,"/",y1%s ,") and (",x2%s ,"/",y2%s ,") \
and are saved in (x1%s /y1%s ) and (x2%s /y2%s )";\
',n,n,n,n,n,n,plotinfo,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n
,n,n,n,n,n,n,n)
Fits a cubic function to the function you say it to. It will save the maxima and minima into x1${functionname} y1${functionname} and x2${functionname} y2${functionname}. It allows a continues use of fitcube and storage of all needed parameters, if different names for the function are chosen. eval fitcube('"data" u 1:2',"function")
set macros
redgreenblue_small = "defined (\
0 0.0 0.0 0.5, \
1 0.0 0.0 1.0, \
2 0.0 0.5 1.0, \
3 0.0 1.0 1.0, \
4 0.5 1.0 0.5, \
5 1.0 1.0 0.0, \
6 1.0 0.5 0.0, \
7 1.0 0.0 0.0, \
8 0.75 0.0 0.0, \
9 0.5 0.0 0.0, \
10 0.25 0.0 0.0, \
11 0.0 0.0 0.0 )"
redgreenblue = "defined (\
0 0.0 0.0 0.5, \
1 0.0 0.0 1.0, \
2 0.0 0.5 1.0, \
3 0.0 1.0 1.0, \
4 0.5 1.0 0.5, \
5 1.0 1.0 0.0, \
6 1.0 0.5 0.0, \
7 1.0 0.0 0.0, \
8 0.5 0.0 0.0)"