3
$\begingroup$

I have data of the form {x,y} for different concentrations. Therefore I added the concentration as z, resulting now in {x,y,z}.

Example data (for concentrations A:1%, B:2%, C:4%):

dataA = {{1, 20, 1}, {2, 19, 1}, {3, 18, 1}, {4, 17, 1}, {5, 16, 1}};

dataB = {{1, 20, 2}, {2, 19.5, 2}, {3, 19, 2}, {4, 19.5, 2}, {5, 16, 2}};

dataC = {{1, 20, 4}, {2, 21, 4}, {3, 20.5, 4}, {4, 19.5, 4}, {5, 16, 4}};

Now I want to make a 3D surface plot from these traces (by 2D-interpolation). How to do that?

Edit: the real data here: dropboxlink

$\endgroup$
  • $\begingroup$ May be ListSurfacePlot3D? (You need at least 10 points) $\endgroup$ – ybeltukov Nov 15 '13 at 22:13
  • $\begingroup$ Thank you, ListSurfacePlot3D seem not to work on my real data. I provided them by editing the question. $\endgroup$ – Shukoff Nov 16 '13 at 8:58
7
$\begingroup$

Perhaps:

r = RotateRight /@ Join[dataA, dataB, dataC];
f = Interpolation[{#[[1 ;; 2]], #[[3]]} & /@ r]; 
Show[{Graphics3D[{PointSize[Large], Point@r}, Axes -> True], 
      Plot3D[f[x, y], {x, 1.`, 4.`}, {y, 1.`, 5.`}]}]

Mathematica graphics

Edit

Here you have your DropBox Data

r0 = Import["c:\\test.xlsx", "Data"]; 
ListPlot3D[ RotateRight /@ Flatten[r0, 1], Mesh -> False,  ColorFunction -> "DarkRainbow"]

Mathematica graphics

$\endgroup$
  • $\begingroup$ ListPlot3D should suffice, it does interpolation automatically. $\endgroup$ – Szabolcs Nov 15 '13 at 22:48
  • $\begingroup$ @Szabolcs Perhaps, yes. But in cases like this one I always find myself tweaking the options of ListPlot3D[] to get a smooth enough surface. $\endgroup$ – Dr. belisarius Nov 16 '13 at 1:09
  • $\begingroup$ Thank you, but all answers seem not to work on my real data. I provided them by editing the question. $\endgroup$ – Shukoff Nov 16 '13 at 8:51
  • $\begingroup$ @Shukoff See edit, please $\endgroup$ – Dr. belisarius Nov 17 '13 at 13:47
  • $\begingroup$ @belisarius: Thank you very much! $\endgroup$ – Shukoff Nov 17 '13 at 13:55

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.