I have the following input file (sample.txt):
A 1 2
B 23 2
C 2 34
D 12 22
E 23 3
F 34 12
I want to create a scatter plot where the second column is the x-axis, the third column is the y-axis, and the first column is the label for each point.
However, I want to only label points that exist in a list L = [B,D,E]
The list which should be defined in the source code (i.e. not in a file), can be changed and should reflect in the plot.
I'm having a difficult time getting this done in PGF plots. Any ideas?
Here's my attempt so far
\documentclass{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.11}
\begin{document}
\begin{tikzpicture}
\begin{axis}
\addplot+ [mark = x,
only marks,
visualization depends on={value \thisrowno{0}}
] table[x index = 1, y index = 2] {annot_no_align.out};
\end{axis}
\end{tikzpicture}
\end{document}
Note: as you can probably tell, I'm a beginner in PGFPlots.


\includeonly. This command eat a list of filenames and then whenever you issue a\inclulde{filename}it checks if thefilenameis in the list. – Symbol 1 Sep 30 '16 at 19:40\def\labelonly{BDF}defines the labels that will be shown. Would you like to ask a new question with a handy MWE, so potentially there are more people can help? (Also, [tag:pgfplots] is now1.15so something might be obsolete. – Symbol 1 Feb 07 '18 at 02:24