# Error 'thisrow_unavailable' with manually positionned (anchor) labels in 'tikzpicture' plot

I want to set labels with manual anchors in my graphic to allow for reading the captions and am trying to apply everything I've read so far. I have an external file for data, given below. The problem is that the line starting with 'every node near coord/.append style' generates an error saying:

Package PGF Math Error: Unknown function thisrow_unavailable_load_table_directly' (in 'thisrow_unavailable_load_table_directly')


Here I am, and blocked. Any help welcome. I have produced a MWE:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath,graphicx,pgfplots,siunitx}
\usepgfplotslibrary{units}
\usepackage{pgfplotstable}
\pgfplotstableset{col sep=semicolon}
\pgfplotsset{compat=1.12}
\begin{filecontents}{aircraft.txt}
aircraft    mph knots   kph introduction    ancre
Boeing-247  188 160 303 1933    east
Douglas-DC3 207 180 333 1936    east
DC4 227 197 365 1942    east
Lockheed-049    313 271 504 1946    west
DC-6B   311 270 501 1947    east
DC-7C   359 312 578 1953    east
DC-8    588 510 946 1958    north
B707    570 495 917 1958    west
B747-100    554 481 892 1966    south
B747-300    567 493 912 1980    south
B747-400    570 495 917 1985    north
\end{filecontents}
\begin{document}
\begin{figure}[ht]
\centering
\begin{tikzpicture}
\begin{axis} [
width=0.95\textwidth,
xtick pos=left, x unit=m,   x unit prefix=k,
ytick pos=left, y unit=m/h, y unit prefix=k, ylabel={Cruise speed},
clip=false      ]
nodes near coords, point meta=explicit symbolic,
visualization depends on={value \thisrow{ancre}\as\myanchor},
every node near coord/.append style={font=\tiny,anchor=\myanchor}
] table [x={introduction}, y={kph},meta={aircraft}] {\aircraft};
\end{axis}
\end{tikzpicture}
\end{figure}
\end{document}

• If add table directly into addplot macro, and comment its call before tikzpicture, it works fine. Where and you have stored your table? Tray to complete your MWE so, that the table aircraft_speed.dat will be part of it. – Zarko Jan 5 '16 at 23:10
• I've finally done the MWE, that was a difficult task, now I hope someone will help me ! – the world is not flat Jan 12 '16 at 11:25

It turns out there is a difference between preloaded table and inline table.

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath,graphicx,pgfplots,siunitx}
\usepgfplotslibrary{units}
\usepackage{pgfplotstable}
\pgfplotsset{compat=1.12}
\begin{filecontents}{aircraft.txt}
\end{filecontents}
\begin{document}
\begin{figure}[ht]
\centering
\begin{tikzpicture}
\begin{axis} [
width=0.95\textwidth,
xtick pos=left, x unit=m,   x unit prefix=k,
ytick pos=left, y unit=m/h, y unit prefix=k, ylabel={Cruise speed},
clip=false      ]
nodes near coords, point meta=explicit symbolic,
visualization depends on={value \thisrow{position}\as\myposition},
every node near coord/.style={font=\tiny,\myposition}
] table [x={introduction}, y={kph},meta={aircraft}] {
aircraft     mph knots kph introduction position
Boeing-247   188 160   303 1933         below
Douglas-DC3  207 180   333 1936         {below right}
DC4          227 197   365 1942         right
Lockheed-049 313 271   504 1946         left
DC-6B        311 270   501 1947         right
DC-7C        359 312   578 1953         right
DC-8         588 510   946 1958         above
B707         570 495   917 1958         left
B747-100     554 481   892 1966         below
B747-300     567 493   912 1980         below
B747-400     570 495   917 1985         above
};
\end{axis}
\end{tikzpicture}
\end{figure}
\end{document}


In pgfplotscoordprocessing.code.tex line 6345-6352 there is

% These macros are-unfortunately- not accessable here. And the
% worst is: error messages are impossible either because they are
% not executed... try to provide useful hints:
% this should work.
\def\getthisrow##1##2{\pgfplotstablegetelem{\coordindex}{##1}\of{#3}{##2}}%
\def\getthisrowno##1##2{\pgfplotstablegetelem{\coordindex}{[index]##1}\of{#3}{##2}}%


This is the only occurrence of the string in the error message. So we might guess that your document, for some reason regarding source of table, encountered these lines, and then stopped.

The author suggests us to use \getthisrow over \thisrow. However it is difficult, if possible, to use \getthisrow inside visualization depends on= since the parser of the latter needs \as. Until now this is all I can tell.

• I found the same (see my comment), however, I was not able to discover, what is going wrong, if table is not part of graph (is given as file). I still learning pgfplots and pgfplotstable ... – Zarko Jan 14 '16 at 4:09
• @Zarko I missed your comment. This seems to be a general problem of visualization depends on. PGFPLOTS defines the error message \def\thisrow@1{thisrow_unavailable_...} in pgfplotscoordprocessing.code.tex and provides an alternative \getthisrow. But its syntax is different form the former , so in visualization depends on` it fails. – Symbol 1 Jan 14 '16 at 4:15