# How to create a surface plot using unequal vectors

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"]"

• 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]?
– kglr
Commented May 9, 2018 at 7:24
• yes, it worked. I got a surface plot. and how to provide log scale only to y-axis in Mathematica Commented May 9, 2018 at 7:27
• vijay, posted the comment as an answer. Re scaling the y axis, you can use ListPlot3D[d3D, ScalingFunctions -> {None, None, "Log"}].
– kglr
Commented May 9, 2018 at 7:32

d3D = Join @@ Thread /@ Thread[{z, {n1, n2, n3}, {m1, m2, m3}}];

• @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];