答案1
我不确定我是否理解了这个问题。但也许你正在寻找类似
\begin{filecontents*}{exampledata.dat}
1 1,1 1.05
2 1,2 1.1
3 text 1.5
4 3,5 0.9
5 3,6 1.3
6 4,2 0.8
\end{filecontents*}
\documentclass[margin=5pt]{standalone}
\usepackage{pgfplotstable}% loads also pgfplots
\pgfplotsset{compat=1.14}
\pgfplotstableread[
display columns/1/.style=string type,
header=false
]{exampledata.dat}{\loadeddata}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
xtick={0,2,...,100},% row numbers for ticks
xticklabel={%
\pgfmathsetmacro\rowindex{int(\tick)}% row index must be an integer
\pgfplotstablegetelem{\rowindex}{[index]1}\of\loadeddata% get the string from the loaded table
\pgfplotsretval% print the resulting ticklabel
},
]
\addplot table [x expr=\coordindex, y index=2]\loadeddata;
\end{axis}
\end{tikzpicture}
\end{document}
结果: