Combined ListPlot3D using arrays of different length

I have three parts of a ListPlot3D that I would like to combine. The problem is, the middle part has more points in one dimension than the other two, which means I can't combine them easily to plot them together.

So in the end I have part1 and part3, two 10x10 arrays, and part2, a 10x19 array. How can I plot them together?

Note that the middle part is not wider/longer than the others, it just has more points to account for a more complicated function graph on that region.

Update:

... the middle part is not wider/longer than the others, it just has more points...

SeedRandom[1]
{part1, part3} = RandomInteger[10, {2, 10, 10}];
part2 = RandomInteger[10, {20, 30}];

i = 1;
{lp1, lp2, lp3} = ListPlot3D[#, DataRange -> {{0, 1}, {0, 1}, {0, 10}},
InterpolationOrder -> 3, PlotStyle -> {Blue, Red, Green}[[i++]],
ImageSize -> 300, BoxRatios -> {1, 1, 2/3}] & /@ {part1, part2, part3};
Row[{lp1, lp2, lp3}]


Translate lp2 and lp3 and Show together:

Show[lp1,
Graphics3D[GeometricTransformation[lp2[[1]], TranslationTransform[{1, 0, 0}]]],
Graphics3D[GeometricTransformation[lp3[[1]], TranslationTransform[{2, 0, 0}]]],
PlotRange -> All, ImageSize -> 500]


Original post:

You can use PadRight to combine the three parts. For example,

{part1, part3} = RandomInteger[10, {2, 5, 5}];
part2 = RandomInteger[10, {5, 12}];
MatrixForm[MatrixForm /@ {part1, part2, part3}]


combined = Join @@ PadRight[{part1, part2, part3}, Automatic, -1];
MatrixForm[combined]


ListPlot3D[combined, PlotRange -> {0, 10}, InterpolationOrder -> 3,
ClippingStyle -> Red, BoxRatios -> {1, 1, 1/2}]


• Thanks for the answer. I guess I should have been clearer about this: the second part is not wider/longer than the others, it just has more points because it is a more complicated curve so more points were necessary to plot it accurately. Apr 21, 2015 at 17:13
• @tan_45, thank you for the clarification. Could you please update your question posting the data you are using?.
– kglr
Apr 21, 2015 at 17:18
• You've managed to answer perfectly even without my data :) Thanks a lot. Apr 21, 2015 at 18:02
• @tan_45, my pleasure. Thank you for the accept.
– kglr
Apr 21, 2015 at 18:04