# Make a Circular ListContourPlot With Data at r increments

I have a List of Temperature Values ranging from r=0, to rmax at different value of z. Currently, the only contour plot I can make is an r-z plot. I have been able reverse the data to produce a plot that ranges from {-rmax, rmax}, but I think it would be more effective to show an r-theta plot at z=10. At each r, the Temperature value should be identical from 0 to 2pi, giving me perfect rings. Since, I do not have any theta values, what is the best was for me to create this plot?

edit: I have created some data similar to the situation I have. The numbers arent exactly the same, but I tried to replicate them as well as possible.

    rmax = 6;
zmax = 10;

T = Table[0, {r, 1, rmax}, {z, 1, zmax}];

T[[All, All]] = {{482.076, 482.075, 482.070, 482.0625, 482.051,
482.038, 482.023, 482.005, 481.9873, 481.967}, {482.084, 482.083,
482.0784, 482.0705, 482.059, 482.0464, 482.030, 482.013, 481.995,
481.978}, {482.109, 482.107, 482.102, 482.094, 482.083, 482.069,
482.053, 482.035, 482.017, 481.999}, {482.149, 482.147, 482.142,
482.134, 482.122, 482.108, 482.0915, 482.072, 482.051,
482.031}, {482.204, 482.202, 482.197, 482.189, 482.177, 482.162,
482.144, 482.123, 482.099, 482.074}, {482.274, 482.272, 482.267,
482.259, 482.247, 482.231, 482.212, 482.189, 482.161, 482.130}};

ListContourPlot[Transpose[T]]

• Where's your data? Oct 21, 2016 at 20:22
• Can you provide the code? I am not sure if I understand the question... If you just want to plot rings, you could use ParametricPlot. Oct 21, 2016 at 20:23

When I understood you correctly, you have for each value of z a list of temperatures. Since you haven't provided data, let us create some fake ones

data = Table[Sin[r]*(2 - Cos[z]), {z, 0., 1/2, 1/19}, {r, 0, Pi/2, Pi/(2*19)}];
ListContourPlot[data]


Now the only missing piece is that you have to make a coordinate transformation. ContourPlot will always use Cartesian coordinates x and y, but what you want to have is for each {x,y} the radius. Centering the origin in the middle, this is easy because you are just calculating the Euclidean distance like in school

$$r= \sqrt{x^2+y^2}.$$

Indeed, this formula is part of the transformation to polar coordinates.

Since you have only a list of temperatures for some r, we will interpolate the places in between and then, we can put this together and use ContourPlot as usual. Then you have it, a Manipulate that gives you the contour plot you like for a chosen z:

Manipulate[
With[{ip = ListInterpolation[data[[z]]]},
ContourPlot[
With[{r = Sqrt[x^2 + y^2]}, ip[Min[20, r]]],
{x, -20, 20}, {y, -20, 20},
RegionFunction -> Function[{x, y}, Sqrt[x^2 + y^2] < 20],
BoundaryStyle -> {Thick, Red}
]
],
{z, 1, Length[data], 1}
]


• This is exactly what I needed! I appreciate all your help :D
– Pfab
Oct 23, 2016 at 17:40

This is admittedly a bit resource intensive:

Some data dependent on r:

data = Table[r^2 - Sin[2 Pi r]^2, {r, -3, 3, 0.01}];


Generate the full array:

array = Table[{i/100, j/100,
data[[Round[Sqrt[i^2 + j^2 + 300]]]]}, {i, -200, 200}, {j, -200,
200}];
ListContourPlot[Flatten[array, 1]]


• may be a little better to use Interpolation instead of Round Oct 21, 2016 at 20:59
• @george2079 You're right, halirutan used Interpolation now, so I'll just leave it. Can't be bothered to alter anyway if the OP doesn't even come back to update his own question. Oct 22, 2016 at 9:07