I have a problem with the gnuplot environment in pgfplots. I already set "--enable-write18" in the argument of pdfLaTeX and added the path of gnuplot.exe to the PATH-variable in the advanced system options.
My problem now is that I can pass code in gnuplot (see picture), below are the 3 lines which I can't pass in the raw-gnuplot-environment in the tikzpicture (see code). What do I wrong? Can someone help, please?
pdfLaTeX-code:
\documentclass[a4paper]{scrartcl}
\usepackage[paperwidth=27cm,paperheight=17cm,margin=0in,showframe]{geometry}
\usepackage{tikz,pgfplots}
\begin{document}
\centering
\begin{tikzpicture}
\begin{axis} [width=21cm, height=14cm,
tick label style={font=\large},
xmin=7700, xmax=7810,
ymin=0, ymax=0.05,
axis x line=box,
axis y line=box
]
\addplot gnuplot [raw gnuplot, id=test, mark=none]{
set xrange [7700:7810];
set yrange [0:0.05];
plot "test.txt" using ($1):($2) with lines;
};
\end{axis}
\end{tikzpicture}
\end{document}
gnuplot-picture:

and finally my data-file: http://www.file-upload.net/download-7764417/test.txt.html
Thank you in advance for your answer!



indexcorresponding to xdata=7700 and 105000 would be index corresponding to xdata=7810 – texenthusiast Jun 27 '13 at 07:29test.txtand its header ? Jake's answer is an demo example, it's not suited for a complicated case of data with header files. Hence post it as new follow up Q or update current Q with the structure of header if it can be read by gnuplot ? – texenthusiast Jun 27 '13 at 07:40xrangeis still applied). And this approach works independently of whether the datafile has a header or not. Apart from that, you're right of course that this is just a workaround, since you need to somehow find the appropriate start and end indices. – Jake Jun 27 '13 at 12:09Selecting interested range of pointsinstead of down sampling. – texenthusiast Jun 27 '13 at 14:20