1
$\begingroup$
n1 = RandomReal[1, 5]
n2 = RandomReal[1, 5]
n3 = RandomReal[1, 5]
m1 = RandomReal[1, 5]
m2 = RandomReal[1, 5]
m3 = RandomReal[1, 5]
z = {0.1, 0.2, 0.3}
data1 = Transpose@{m1, n1};
ListPlot[data1]

I want to create a surface plot using above data.for given z=0.1 ListPlot[data1], for z=0.2 z=0.1 ListPlot[data2]....how to combine all this to get a surface plot?. I tried ListPlot3D but work only with matrices. how to overcome this problem. And the resulting surface plot should be like in the x-axis (z=0.1,z=0.2,z=0.3) and in the y-axis (n1,n2,n3) and in z-axis (m1,m2,m3). And in my actual program, I am getting error something like "SystemException["memory allocation failure"]"

$\endgroup$
  • $\begingroup$ does this work: {data1, data2, data3} = Transpose /@ Transpose[{{m1, m2, m3}, {n1, n2, n3}}]; d3D = Join @@ (Prepend @@@ # & /@ (Thread /@ Thread[{ {data1, data2, data3}, z}])); ListPlot3D[d3D]? $\endgroup$ – kglr May 9 '18 at 7:24
  • $\begingroup$ yes, it worked. I got a surface plot. and how to provide log scale only to y-axis in Mathematica $\endgroup$ – acoustics May 9 '18 at 7:27
  • $\begingroup$ vijay, posted the comment as an answer. Re scaling the y axis, you can use ListPlot3D[d3D, ScalingFunctions -> {None, None, "Log"}]. $\endgroup$ – kglr May 9 '18 at 7:32
2
$\begingroup$
d3D = Join @@ Thread /@ Thread[{z, {n1, n2, n3}, {m1, m2, m3}}]; 
ListPlot3D[d3D]

enter image description here

$\endgroup$
  • $\begingroup$ But the log thing didn't work $\endgroup$ – acoustics May 9 '18 at 7:38
  • $\begingroup$ @vijay, does ScalingFunctions -> {None, None, {Log[#] &, Exp[#] &} } work? It seems to work in version 11.2 (in wolfram cloud) when I use m1 = RandomReal[10^4, 5];m2 = RandomReal[10^4 , 5]; m3 = RandomReal[10^4 , 5]; $\endgroup$ – kglr May 9 '18 at 7:44
  • $\begingroup$ No, it is also not working $\endgroup$ – acoustics May 9 '18 at 9:48

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.