0
$\begingroup$

I want to plot something very similar to what is plotted by @Sjoerd C. de Vries in Can 2D and 3D plots be combined so that the 2D plot is the bottom surface of the 3D plot boundary? I need to combine a ListPlot3D with ListLinePlot. I have manged to include ListLinePlot following his method but I was not able to include the ListPlot3D. Here a toy a simple example:

iz = -2;
aa = 1;
a = ListPlot3D[{{0, 0, 3/5}, {0, 1, 0}, {1, 0, -6/5}, {1, 1, 4/5}}];
b = ListLinePlot[{0, 4, 2, 7, 4, 9}, PlotStyle -> Red]; surfacePlot = 
Show[{Graphics3D[{EdgeForm[], {Texture[b], 
  Polygon[{{-aa, -aa, iz}, {aa, -aa, iz}, {aa, aa, iz}, {-aa, aa, 
     iz}}, VertexTextureCoordinates -> {{0, 0}, {1, 0}, {1, 
      1}, {0, 1}}]}}], a}]

Please, understand that the ListPlot3D shown here is a toy example of the real one, which has curved complex structure, not simple plans. Therefore, I really need a solution in which I just include the ListPlot3D in the Graphics3D.

Thank you.

$\endgroup$
0

1 Answer 1

1
$\begingroup$

I am not sure what you are looking for. You can directly combine Graphics3D using Show command.

a = ListPlot3D[{{1, 2, 3}, {0, 0, 0}, {-1, 2, -6}, {5, 5, 4}}];
b = ListLinePlot[{0, 4, 2, 7, 4, 9}];
surfacePlot = 
 Show[{Graphics3D[{EdgeForm[], {Texture[b], 
      Polygon[{{-1, -1, -1}, {1, -1, -1}, {1, 1, -1}, {-1, 1, -1}}, 
       VertexTextureCoordinates -> {{0, 0}, {1, 0}, {1, 1}, {0, 
          1}}]}}], a}]

$\endgroup$
8
  • $\begingroup$ Now let us change a such it has a squre cross section : a = ListPlot3D[{{0, 0, 3/5}, {0, 1, 0}, {1, 0, -6/5}, {1, 1, 4/5}}]; 1) Can you make them match in such a way that both occupy the entire section of the box.2) Can you make both figures keep their original colour... ? $\endgroup$
    – Mencia
    Jun 22, 2015 at 12:09
  • $\begingroup$ Also push the ListLinePlot below so that they dont touch by doing ...Polygon[{{-1, -1, -4}, {1, -1, -4}, {1, 1, -4}, {-1, 1, -4}}... $\endgroup$
    – Mencia
    Jun 22, 2015 at 12:10
  • $\begingroup$ @Mencia I still do not understand what you are trying to do. Can you provide more info? $\endgroup$
    – Kattern
    Jun 22, 2015 at 13:16
  • $\begingroup$ @Mencia you can update them in the question. $\endgroup$
    – Kattern
    Jun 22, 2015 at 13:16
  • $\begingroup$ I just edited the question, 1) now I want that the area of the section of the ListPlot3D (the projection to the z=0 plane)matches with the section of the LitLinePlot. 2) Also I would like both figures to keep the colours they have if you plot them independently. $\endgroup$
    – Mencia
    Jun 22, 2015 at 13:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.