\usepackage{tikz}
\usepackage{pgfplots}
\begin{tikzpicture}
...
\end{tikzpicture}
\begin{tikzpicture}
\begin{axis}
\addplot coordinates {
( 338.1, 266.45 )
( 169.1, 143.43 )
( 84.5, 64.80 )
( 42.3, 34.19 )
( 21.1, 9.47 )};
\end{axis}
\end{tikzpicture}
\begin{tikzpicture}
\begin{axis}
\addplot[only marks] coordinates {
( 338.1, 266.45 )
( 169.1, 143.43 )
( 84.5, 64.80 )
( 42.3, 34.19 )
( 21.1, 9.47 )};
\addplot[mark = none] coordinates {( 350, 279 )
( 0, 0 )};
\end{axis}
\end{tikzpicture}
tx
0.000000 -0.000000
0.001000 20.326909
0.002000 19.856433
0.003000 8.330376
0.004000 13.982180
0.005000 17.589183
0.006000 19.611675
\begin{tikzpicture}
\begin{axis}[ no markers,
xmin=0, xmax=0.3 ]
\addplot table[x=t,y=x] {foo.dat};
\end{axis}
\end{tikzpicture}
\begin{tikzpicture}
\begin{axis}[
ylabel=Data,
xlabel=time ]
\addplot[only marks] coordinates {
( 338.1, 266.45 )
( 169.1, 143.43 )
( 84.5, 64.80 )
( 42.3, 34.19 )
( 21.1, 9.47 )};
\addlegendentry{Dots}
\addplot[mark = none] coordinates {( 350, 279 )
( 0, 0 )};
\addlegendentry{Line}
\end{axis}
\end{tikzpicture}
Source: https://habr.com/ru/post/94931/