`visualization depends on` doesn't work with table from pgfplotstable
Brought to you by:
cfeuersaenger,
ludewich
In the following example the first tikzpicture/axis, which loads the data from a temporary output file, works perfectly, but the second, which uses the \data macro, fails on a current texlive 2015 with ! Missing $ inserted.
\documentclass[10pt,a4paper]{report}
\usepackage{pgfplots}
\pgfplotsset{compat=1.13}
\usepackage{pgfplotstable}
\begin{document}
\pgfplotstableread[col sep=space]{
x y w1 w2
1 1 2 4
2 2 1 3
3 3 4 2
4 4 3 1
}\data
\pgfplotstablesave{\data}{pgfplotstempout.dat}
\begin{tikzpicture}
\begin{axis}[]
\addplot[
scatter,
only marks,
scatter src=explicit,
visualization depends on=\thisrow{w2}\as\wtwo,
scatter/@pre marker code/.append style={
/tikz/mark size=\wtwo
}
]
table[x=x,y=y,meta=w1]{pgfplotstempout.dat};
\end{axis}
\end{tikzpicture}
\begin{tikzpicture}
\begin{axis}[]
\addplot[
scatter,
only marks,
scatter src=explicit,
visualization depends on=\thisrow{w2}\as\wtwo,
scatter/@pre marker code/.append style={
/tikz/mark size=\wtwo
}
]
table[x=x,y=y,meta=w1]{\data}; %error
\end{axis}
\end{tikzpicture}
\end{document}
Does the answer of Symbol 1 give a possible hint to an implementation of a solution? http://tex.stackexchange.com/a/356790/95441
The bug is also reported at
Last edit: Stefan Pinnow 2017-12-14
The problem with
pgfplotstablereadis not constrained tovisualization depends on. There also is a problem withmatrix plotwhen data is stored in apgfplotstable. I've added an example to https://tex.stackexchange.com/q/395573The reason why loaded tables are different (and, in some aspects, more difficult) is that TeX is so awkward when it comes to data structures: it is unable to make random access into a table... (unless one uses extreme ammounts of memory).
I found a solution which solves
It will spit out an error for
but it is a major improvement such that I consider this bug fixed.
I will file a separate follow-up ticket for the issue reported by Florian; it seems to be unrelated.
Last edit: Stefan Pinnow 2017-11-12
see https://sourceforge.net/p/pgfplots/bugs/192/
The issue is improved to some extend: numeric values can now be processed. But the following is still impossible:
\addplot[x filter/.code={\ifdim\thisrow{...} = ...}] table {\data};\thisrowfor string columnsWe decided to keep it this way for now and address the remaining open issues in a dedicated follow-up ticket of lower prio
Last edit: Stefan Pinnow 2017-11-12
https://sourceforge.net/p/pgfplots/bugs/193/