# Plot data in a tabular environment using plgfplot

I have a tabular environment which has two columns representing x and y data. Is there a way for pgfplots to reference the data in that tabular and plot it?

Example table:

\begin{tabular}{ll}
1 & 3.4 \\
2 & 6.7 \\
3 & 8.9 \\
4 & 12.4 \\
5 & 7.8
\end{tabular}


Current method of using pgfplot:

\addplot coordinates {
( 1, 3.4 )
( 2, 6.7 )
( 3, 8.9 )
( 4, 12.4 )
( 5, 7.8 )
};


Is there a way for pgfplot to reference the data in the tabular environment instead of repeating the data in the addplot (without using externals files if possible).

You can go the other way as you can read your data and either use it in tabular code or in plotting

\documentclass{article}
\usepackage{pgfplotstable}
\pgfplotsset{compat=1.12}

\begin{document}
1 & 3.4 \\
2 & 6.7 \\
3 & 8.9 \\
4 & 12.4 \\
5 & 7.8 \\
}\mytable

\pgfplotstabletypeset[column type=l,every head row/.style={output empty row}]{\mytable}

\begin{tikzpicture}
\begin{axis}