1

I am writing a technical paper in which I want to compare some works in my references. I want to draw a scatter plot between two columns of data (x and y) and the third column (the numeric reference label [1], [15],.. etc) as the text label on all the points.

I can do this using MATLAB of course, and set the point labels by hand. However anytime I add or remove a reference from my bibliography the numeric labels on my plot will have to be readjusted.

Is there any tool in LaTeX to update the reference labels in the scatter plot automatically?

Alexis Pigeon
  • 1,519
  • 9
  • 14
picasso
  • 616

1 Answers1

1

You can use pgfplots, and the example from section 3.4.3 Scatter Plot Use-case C of the manual (for version 1.9).

\documentclass{article}
\usepackage{pgfplots}
\pgfplotsset{compat=1.9}
\begin{document}

\begin{tikzpicture}
\begin{axis}[
  enlargelimits=0.2,
  ]
\addplot+[nodes near coords,only marks,
  point meta=explicit symbolic]
  table[meta=label] {
x y label
0.5 0.2 \cite{a}
0.2 0.1 \cite{b}
 };
\end{axis}
\end{tikzpicture}


\begin{thebibliography}{9}
\bibitem{a} This guy wrote this
\bibitem{b} This other guy wrote that
\end{thebibliography}
\end{document}

enter image description here

Torbjørn T.
  • 206,688