I have a few files in the following format:
x y
12 12
12 13
13 15
15 15
15 13
13 12
12 10
10 8
8 8
8 10
10 12
12 12
12 10
10 10
And I wanted to plot them as a directed graph in a .tex file using pgfplots.
The code I am currently using is this one
\usepackage{pgfplots}
\begin{center}
\begin{tikzpicture}
\begin{axis}[title=File1,
xlabel={},
ylabel={}]
\addplot table {data-1.txt};
\end{axis}
\end{tikzpicture}
\end{center}
This plots the points with lines between them but it is not enough for what I need. I would like to
- Set a different color for the first point
- Have arrows indicating between the dots indicating the "path" the dots take.
Some files (as the one in the example) may have overlapping nodes. If your solution could handle this scenario it would save me a lot of effort.
Another thing that I would like to do would be to do a linear interpolation of the points in the D-Graph that is generated. However I am totally clueless about how I am going to do that. I know that this seems rather awkward and might even be impossible with the most common linear interpolation algorithms, but if you could lend me a hand in that I would be very grateful.
As an example of the process described above, I would like to get something similar to this:
linear regression
feature of PGFPlots to achieve this.