I would like to make TikZ plots from Gnuplot or to make the Gnuplot more similar to the TikZ results (same fonts, lines and points).
I use this script
set xlabel "Time, t [s]" # font " Helvetica,16"
set ylabel "Batch identification probability, b(t)" # font "Helvetica,16"
load "estilos100.txt"
set key spacing 1.5
set key right bottom
set xrange [0:2]
# set terminal latex
set terminal postscript enhanced color dashed
set key box
set out "bK16.eps"
plot 'FSAK16.dat' using 1:($9 == 0 ? NaN : ($9 == 1? NaN : $9)) title 'N=100, K=16' with lp ls 10,\
'FSAK16-ERRORES.dat' using 1:($9 == 0 ? NaN : ($9 == 1? NaN : $9)) title 'N=100, K=16, cap' with lp ls 11,\
'FSAK16-POISSON.dat' using 1:($9 == 0 ? NaN : ($9 == 1? NaN : $9)) title 'P(@^{\320}N=100), K=16' with lp ls 20,\
'FSAK16-POISSON-ERRORES.dat' using 1:($9 == 0 ? NaN : ($9 == 1? NaN : $9)) title 'P(@^{\320}N=100), K=16, cap' with lp ls 22
The data files have many rows and columns and are in this link.
EDIT
Following the comments, I have tried to plot using TikZ addplot
as
\documentclass[border=1mm]{standalone}
\usepackage{tikz,pgfplots}
\begin{document}
\centering
\begin{tikzpicture}
\begin{axis} [
%width=21cm, height=14cm,
% tick label style={font=\large},
xmin=0, xmax=2,
% xtick={7700,7725,...,7800},
axis x line=box,
axis y line=box
]
\addplot gnuplot [raw gnuplot, id=test0, mark=none]{
set xrange [0:2];
%set yrange [0:0.05];
% plot "test.txt" using ($1):($2) every 1:1:100500::105000 with lines;
plot 'FSAK16.dat' using 1:($9 == 0 ? NaN : ($9 == 1? NaN : $9)) %title 'N=100, K=16' with lp ls 10
};
\addplot gnuplot [raw gnuplot, id=test1, mark=none]{
set xrange [0:2];
plot 'FSAK16-ERRORES.dat' using 1:($9 == 0 ? NaN : ($9 == 1? NaN : $9)) %title 'N=100, K=16, cap' with lp ls 11 %,\
};
\end{axis}
\end{tikzpicture}
\end{document}
Which it plots the lines but not the points. How I could plot the lines and the points together?.
gnuplot
to generate the data and thenpgfplots
to produce the plot.mark=none
means that no mark is displayed. Try usingmark=square*
mark=*
,and'mark=triangle
, etc. See p. 183 of the pgfplots manual. If this has solved your question, please post your solution as an answer as it may be helpful to others in the future.