Closed pgf-tikz-bot closed 4 years ago
Migrated from SourceForge https://sourceforge.net/p/pgfplots/bugs/204/#5362 Author: peter-unige Timestamp: 2018-06-07 15:21:10.741000
Sorry the condition in the title is not required.
Migrated from SourceForge https://sourceforge.net/p/pgfplots/bugs/204/#b896 Author: mo-gul Timestamp: 2018-06-07 16:21:13.881000
I guess there is no bug. See the comments in the code. Do you agree?
\documentclass[border=5pt]{standalone}
\usepackage{pgfplots}
\usepackage{pgfplotstable}
\pgfplotstableread{
X Y
1 2
3 4
6 5
}\buga
% you have to state `col sep' here for loaded tables
% while *loading* it needs to be known what the appropriate column
% separator is needed
\pgfplotstableread[
col sep=comma,
]{
1,2
3,4
6,5
}\bugb
\begin{document}
\begin{tikzpicture}
\begin{axis}
% removed all `col sep's, because they don't work here for "loaded tables"
% replaced `\thisrow' by `\thisrowno'
\addplot table [x=X, y expr={\thisrowno{1}/2}] {\buga};
\addplot table [x=X, y expr={\thisrow{Y}/2}] {\buga};
% replaced `\thisrow' by `\thisrowno'
\addplot table [x index=0,y expr={\thisrowno{0}/2}] {\bugb};
\end{axis}
\end{tikzpicture}
\end{document}
Migrated from SourceForge https://sourceforge.net/p/pgfplots/bugs/204/#2193 Author: mo-gul Timestamp: 2018-06-07 19:39:56.283000
Migrated from SourceForge https://sourceforge.net/p/pgfplots/bugs/204/ Author: peter-unige Timestamp: 2018-06-07 15:19:13.047000
The following MWE shows the problem. Of course the pgfplotstableread could also be inserted directly into the addplot command. I hope this helps improving this very nice package. Thank you!
By the way the only version which works properly is commented out... Enjoy finding the bug. ;)