Using this example for a scatter plot, I hacked together a working plot for my document. To perfectionize my plot, I would like to have each plotted point (circle or square) to also be a hyperlink to the rest of my text -- for user comfort. I.e. if I click on the blue circle 19 I get taken to the text section "Hypothesis 19".
Is there a way for pgfplotstable to read label references from the table and hyperlink to the referred part, such as I sketched in the commented out data table?
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{pgfplotstable}
\pgfplotsset{compat=1.17}
\colorlet{myred}{red!40!white}
\colorlet{myblue}{blue!30!white}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
xtick={-1.5,-0.5,0.5,1.5},
x tick label style={align=center},
xticklabels={strongly\\disagree,disagree,agree,strongly\\agree},
xmin=-1.55,
xmax=1.55,
ymin=0.385,
ymax=0.715,
xlabel=Mean Agreement,
ytick={0.4,0.5,0.6,0.7},
y tick label style={align=center},
yticklabels={more\\controversial,0.5,0.6,more\\consensual},
ylabel=Consensus,
xmajorgrids=true,
ymajorgrids=true,
grid style={ultra thin, gray!20!white},
every node near coord/.append style={anchor=center,font=\footnotesize,color=black},
]
\addplot+[
scatter, only marks, mark size=4.25pt,
scatter/@pre marker code/.append code={%
\let\pgfplotspointmeta=\mediansymbol
},%
scatter/classes*={
CIRCLE={mark=*,myblue},%
SQUARE={mark=square*,myred}},%
nodes near coords*={\pgfmathprintnumber[int detect]{\hypothesisnumber}},
visualization depends on={value \thisrow{mediansymbol} \as \mediansymbol},
visualization depends on={\thisrow{hypothesisnumber} \as \hypothesisnumber},
]
table[meta=mediansymbol]{
%what it currently looks like (column `empty' is not used)
x y empty mediansymbol hypothesisnumber
-0.2407407407 0.5826392204 0 SQUARE 11
0.7413793103 0.5908883524 0 CIRCLE 19
%what it should look like
%x y empty mediansymbol hypothesisnumber hyperlinkto
%-0.2407407407 0.5826392204 0 SQUARE 11 hypo:oneone
%0.7413793103 0.5908883524 0 CIRCLE 19 hypo:onenine
};
\coordinate (legend) at (axis description cs:0.05,0.11);
\end{axis}
%manually hacked legend:
\node[rectangle,minimum size=8.5pt,fill=myred,label=right:{median disagree},yshift=1.3em] at (legend) {};
\node[circle,minimum size=8.5pt,fill=myblue,label=right:{median agree},yshift=-0.5em] at (legend) {};
\end{tikzpicture}
\textit{Hypothesis 19. Perfecting a \textit{pgftablesplot} is not a $80\%-20\%$ ratio, try $99\%-1\%$.}
\label{hypo:onenine}
This hypothesis is a tautology, qed.
\end{document}
(note, that I could not get rid of the data column "empty", which serves no actual purpose -- I also had to add a legend, manually)