Menu

#109 `visualization depends on` doesn't work with table from pgfplotstable

v1.0 (example)
closed-fixed
None
9
2017-11-12
2016-02-18
U_Fischer
No

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}

Discussion

  • Stefan Pinnow

    Stefan Pinnow - 2017-03-04

    Does the answer of Symbol 1 give a possible hint to an implementation of a solution? http://tex.stackexchange.com/a/356790/95441

     
  • Florian

    Florian - 2017-10-12

    The problem with pgfplotstableread is not constrained to visualization depends on. There also is a problem with matrix plot when data is stored in a pgfplotstable. I've added an example to https://tex.stackexchange.com/q/395573

     
  • Christian Feuersänger

    The 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

    visualization depends on=\thisrow{w2}\as\wtwo,
    

    It will spit out an error for

    visualization depends on=value \thisrow{w2}\as\wtwo,
    

    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
  • Christian Feuersänger

    • status: open --> pending
     
  • Christian Feuersänger

    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};
    • \thisrow for string columns

    We 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
  • Christian Feuersänger

    • status: pending --> closed-fixed
     
MongoDB Logo MongoDB