Quantcast
Channel: Loop over pgfplotstable rows - TeX - LaTeX Stack Exchange
Viewing all articles
Browse latest Browse all 3

Answer by John Kormylo for Loop over pgfplotstable rows

$
0
0

You can pull off individual elements using \pgfplotstablegetelem.

\documentclass{standalone}\usepackage{tikz}\usepackage{pgfplots}\usepackage{pgfplotstable}\begin{document}\pgfplotstableread{x y1 22 3}\loadedtable% and look like this\begin{tikzpicture}\foreach \row in {0,1} {  \pgfplotstablegetelem{\row}{x}\of\loadedtable  \let\x=\pgfplotsretval  \pgfplotstablegetelem{\row}{y}\of\loadedtable  \let\y=\pgfplotsretval  \draw (0,0) -- (\x,\y);}\end{tikzpicture}\end{document}

Viewing all articles
Browse latest Browse all 3

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>