Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Here is the data

http://wikisend.com/download/405620/datapoints.dat

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?

share|improve this question
2  
It'd be good to get the data. –  Vitaliy Kaurov Feb 15 '13 at 2:35
1  
I think we really need to see the data, but until then take a look at ListCurvePathPlot. –  Mr.Wizard Feb 15 '13 at 2:39
    
How do I include a .dat file here? –  l3win Feb 15 '13 at 3:10
    
You have to upload it somewhere else and link it. Sorry. :-/ –  Mr.Wizard Feb 15 '13 at 3:15
1  
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? –  whuber Feb 15 '13 at 3:28

1 Answer 1

up vote 6 down vote accepted

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]

web

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]];
share|improve this answer
    
I have included a link to the data wikisend.com/download/405620/datapoints.dat –  l3win Feb 15 '13 at 3:15
1  
OK, I just checked that my solution works with your data. Problem solved. Just name your data list t and use the Show command. –  Jens Feb 15 '13 at 3:19
    
I just recreated your method and then came here to post it, only then realizing you'd done the same thing, but better. +1 :) –  Mr.Wizard Feb 15 '13 at 3:25
    
Looks good. Is there a way to reduce the line width? –  l3win Feb 15 '13 at 3:36
    
@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]. –  Mr.Wizard Feb 15 '13 at 3:41

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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