Here is the data


I have (x,y) data for a grid around an airfoil and I am trying to figure out how I can draw radial and polar lines for the grid to look like a mesh. I have tried ListPlot and ListLinePlot, but I have only managed to get circular lines, but not radial ones.

Here is what the data looks like: Airfoil

and here is ListLinePlot

Airfoil LLplot

How can I improve these images?

  • 2
    $\begingroup$ It'd be good to get the data. $\endgroup$ – Vitaliy Kaurov Feb 15 '13 at 2:35
  • 1
    $\begingroup$ I think we really need to see the data, but until then take a look at ListCurvePathPlot. $\endgroup$ – Mr.Wizard Feb 15 '13 at 2:39
  • $\begingroup$ How do I include a .dat file here? $\endgroup$ – l3win Feb 15 '13 at 3:10
  • $\begingroup$ You have to upload it somewhere else and link it. Sorry. :-/ $\endgroup$ – Mr.Wizard Feb 15 '13 at 3:15
  • 1
    $\begingroup$ A mere set of points, such as that in the data file, is practically meaningless--there are infinitely many ways they could be gridded. In fact, from the images it appears that the points have little to do with aerodynamics and everything to do with the interpolation algorithm. What are you really trying to achieve? Are you trying to depict flow and potential around the airfoil? Or are you trying to depict a finite element mesh used to solve equations? (That appears to be the sense in which the existing answer is offered.) Something else? $\endgroup$ – whuber Feb 15 '13 at 3:28

By looking at the plot and the connecting line stretching along the x axis, I'm guessing the structure of the data is as follows (I could be wrong, but this seems to make a lot of sense):

t = Flatten[
   Table[r {Cos[x], 2 Sin[x]}, {r, 1, 10}, {x, 0, 2 Pi, Pi/10}], 1];

Show[ListLinePlot[#], ListLinePlot[Transpose[#]]] &@
 Partition[t, Nearest[(# -> Range[Length[#]]) &@Rest@t, t[[1]]] + 1]


So what I did then is to re-create an additional level in the given list t such that the individual round-trips around the origin (airfoil) can be separated. That list is then plotted as is to get azimuthal lines, and transposed to get radial lines.

Not knowing the dimension of the data, I had to add some gymnastics to feel out the length of the azimuthal sublists corresponding to a round-trip. I did this using Nearest to find when the points revolve back to the closest distance to the first element of the list.

If you want the grid to look more uniform and thinner, you could do something like this before plotting:

SetOptions[ListLinePlot, PlotStyle -> Directive[Black, Thin]];
  • $\begingroup$ I have included a link to the data wikisend.com/download/405620/datapoints.dat $\endgroup$ – l3win Feb 15 '13 at 3:15
  • 1
    $\begingroup$ OK, I just checked that my solution works with your data. Problem solved. Just name your data list t and use the Show command. $\endgroup$ – Jens Feb 15 '13 at 3:19
  • $\begingroup$ I just recreated your method and then came here to post it, only then realizing you'd done the same thing, but better. +1 :) $\endgroup$ – Mr.Wizard Feb 15 '13 at 3:25
  • $\begingroup$ Looks good. Is there a way to reduce the line width? $\endgroup$ – l3win Feb 15 '13 at 3:36
  • $\begingroup$ @l3win The line width should default to the thinnest possible. If you have it set to something else try PlotStyle -> AbsoluteThickness[1] inside ListLinePlot. If you want the lines to appear lighter (but not be thinner) try PlotStyle -> Opacity[0.5]. $\endgroup$ – Mr.Wizard Feb 15 '13 at 3:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.