latex - Duplex label and tics in gnuplot (epslatex) -
i trying draw graphs reading values file, using epslatex - gnuplot (version 5.0 patchlevel 1), follows:
# gnuplot.gp set term epslatex set output "figure.tex" set xlabel "x" set ylabel "y" set nokey set size square set xrange [0:1.0] set yrange [0:1.0] for[idline = 1 : 4 : 1]{ a1 = system("cat data.dat | awk 'nr == ".idline." {print $1}'") a2 = system("cat data.dat | awk 'nr == ".idline." {print $2}'") plot x**a1 + a2 lines lt 1 lc rgb "black" }
and data is
# data.dat 1.0 0.0 2.0 0.0 3.0 0.0 4.0 0.0
though managed draw figure i've wanted, there still problem labels getting bolder single plot (please see figures below, hope image quality enough tell difference ...). seems these phenomenon occur due duplex letters of several times plotting.
i have tried several way avoid problem, non of these didn't work. there smart way avoid problem?
in case can read whole file variable , extract parameters word
. can iterate on parameter plot ...
generates single graph several plots:
# gnuplot.gp set term epslatex set output "figure.tex" set xlabel "x" set ylabel "y" parameters = system("awk '!/^#/' data.dat") set xrange [0:1] plot [i=1:words(parameters):2] x**word(parameters, i) + word(parameters, i+1) lines notitle
the awk
call removes comment lines input file. if doesn't have comments, use parameters = system("cat data.dat")
.
Comments
Post a Comment