# Drawing airfoils from .dat external file

I am trying to include plots of airfoils in my report and have tried using this method:

http://www.texample.net/tikz/examples/airfoil-profiles/

Initially, I had multiple errors and the document would not display. The problem I discovered, was that the data posted was probably not the same as the data used. I removed the foil name and all other empty lines before and after the data coordinates. The major problem was the multiple spaces between the x and y coordinates.

After altering the coordinates with a single space between x and y, I was able to display airfoils without any additional problems.

Slightly altered code:

\documentclass{article}
\usepackage{tikz}
\usepackage{caption}
\usepackage{refstyle}

\begin{document}

\newcounter{y}
\setcounter{y}{0}

\begin{figure}[h]
\centering
\begin{tikzpicture}
\foreach \lbl / \fn in {
EPPLER 625/e625.dat,
WORTMANN FX 2/fx2.dat,
EPPLER 664 (EXTENDED)/e664ex.dat,
CLARK Y/clarcy.dat,
NACA Munk M-4 airfoil/m4.dat}{
\draw[yshift=-\arabic{y}cm,scale=3] node[left=0.5cm] {\lbl}
plot file{\fn} -- cycle;
\stepcounter{y}}

\end{tikzpicture}
\caption{Different airfoils}
\label{fig:foils}
\end{figure}

\end{document}


Note: The airfoil .dat files were placed in the same folder as the LaTeX program"

• Welcome to TeX.SX! Did you use the literal code as shown on that site or did you make any modifications to it? It's better add the relevant code to your question instead of relying on external sites. Also, what errors did you get? – siracusa Jul 10 '19 at 8:17
• I used the literal code from the site. No editing. – FC_Stevens Jul 10 '19 at 8:33
• After delving deep I discovered that the data the OP used was probably not the same as the data he posted. Some of the files were not in the correct format (it had multiple spaces between the x and y coordinates). I have solved the problem. Thank you. – FC_Stevens Jul 10 '19 at 8:34
• Okay, you could post your solution as an answer here and accept it, or add a comment to that site if you want. I guess this could be useful for future readers with the same issue. Otherwise I'd vote to close this question. – siracusa Jul 10 '19 at 8:38
• I am not sure how to post an answer to my own question (I have no answering box). Therefore I re-wrote my question into a solution. I hope this is acceptable. – FC_Stevens Jul 10 '19 at 9:24