The package pgfplotstable defines a key string replace* that can be used to replace strings inside a typeset table (in \pgfplotstabletypeset); for instance (quoting from the manual)
\pgfplotstabletypeset[
string replace*={2}{6},
col sep=&,row sep=\\]{
colA & colB & colC \\
11 & 12 & 13 \\
21 & 22 & 23 \\
}
Is there a way to use the same string replacement method when I am plotting the values in the table using pgfplots? For instance, I would like to write something like
\documentclass{standalone}
\usepackage{pgfplots}
\usepackage{pgfplotstable}
\usepackage{tikz}
\usepackage{filecontents}
\begin{filecontents}{example.dat}
A B
1 2
3 4
4 5
5 4
\end{filecontents}
\begin{document}
\pgfplotstableread[string replace*={4}{-5}]{example.dat}\loadedtable
\begin{tikzpicture}
\begin{axis}
\addplot table[x=A,y=B] \loadedtable; % putting a string replace in this line doesn't work either.
\end{axis}
\end{tikzpicture}
\end{document}
which does not work: the table is typeset, but the numbers 4 are not replaced with -5, that is, the string replace* key seems to be ignored.
In case there is a better solution: what I am really trying to do is replacing all NaN with infinity (or a sufficiently large number) in an error bar plot: conceptually they represent the fact that the algorithm failed, so I need a full bar, not an empty one.
