Message Boards Message Boards

[✓] Merge nine 3D plots into a bigger one?

GROUPS:

Hey there Community, I have a problem regarding data processing and plot creation.

My task is to merge 9 sets of data, each corresponding to a 3D-Plot, in one big 3D-Plot. The data is given in an 3x3 pattern.

1 2 3

4 5 6

7 8 9

The idea i had was to add the data and provide the x and y values with a corresponding offset. Can anyone help?

Cheers, Paul

POSTED BY: Paul Schwarz
Answer
6 days ago

You're problem is not very clear, please read the rules/guide http://community.wolfram.com/groups/-/m/t/270507 . Provide your code/data and the expected outcome.

3x3 pattern is kinda unclear; You might need ArrayFlatten, Flatten, Grid, or Partition or ... those functions come to mind...

POSTED BY: Sander Huisman
Answer
6 days ago

given a list of 9 separate Graphics3D

g={ Graphics3D1, Graphics3D2, ...}

you could use

Show [ g ]

note also: Graphics3D[ { g[[1]], g[[2]], ... } ]

POSTED BY: John Hendrickson
Answer
6 days ago

Hi Paul,

this might be true only up to some permutation of indices, but might work as a general idea. Suppose you have a 9 3D-images:

Table[Image3D[RandomReal[1, {3, 3, 3}]], 9]

or better just the raw data.

enter image description here

We now use Partition to get it into a 3 by 3 array, and then flatten appropriately (I hope, please check whether the levels in Flatten are correct):

Image3D[Transpose[Flatten[#, 1] & /@ Transpose[Flatten[#, 1] & /@ Partition[Table[RandomReal[1, {3, 3, 3}], 9], 3]]]]

enter image description here

Cheers,

Marco

POSTED BY: Marco Thiel
Answer
6 days ago

The solution of Marco Thiel is exactly what i am looking for. The Problem with it is just, that i do not have 3D-Images, but 9 times a "ListPlot3D".

Thanks for your effort!

POSTED BY: Paul Schwarz
Answer
6 days ago

Hi Paul,

I am not sure what you really want to achieve. Is this here what you want?

GraphicsGrid[Partition[Table[ListPlot3D[RandomReal[1, {60, 3}]], {9}], 3]]

enter image description here

This is kind of in a "single" 3 by 3 plot. If you want all of them in one single plot (which is not what I think you need) you might simply want:

colorschemes = RandomSample[ColorData["Gradients"], 9]
Show[Table[ListPlot3D[RandomReal[1, {60, 3}], ColorFunction -> colorschemes[[i]]], {i, 9}]]

enter image description here

Best wishes,

Marco

POSTED BY: Marco Thiel
Answer
6 days ago

Not really. In yourfirst example you created nine 3D-Images and merged them to one in a 3x3 pattern.

This is what i need to do, but with 9 datasets, each giving a 3D-ListPlot.

I hope, this helps you understand my problem!

Cheers

POSTED BY: Paul Schwarz
Answer
6 days ago

Ok, another attempt. Given 9 datasets:

data = Table[RandomReal[1, {60, 3}], {9}];

Combine the data:

datacombined = Table[Plus[#, {i - 1, j - 1, 0}] & /@ (Partition[data, 3][[i, j]]), {i, 1, 3}, {j, 1, 3}];

Plot the data:

ListPlot3D[Flatten[datacombined, 2]]

enter image description here

POSTED BY: Marco Thiel
Answer
6 days ago

I think this is exactly what i was looking for!

Thank you!

POSTED BY: Paul Schwarz
Answer
6 days ago

Group Abstract Group Abstract