0
$\begingroup$

I have a ListLinePlot and a ListPlot3D that I want to combine using Show. I do not know how to change the positions of the figures. Here a toy example:

a = ListPlot3D[{{0, 0, 3}, {0, 1, 3}, {1, 0, 3}, {1, 1, 3}, {0.25, 
 0.5, 1}, {0.75, 0.5, 1}}];
b = ListLinePlot[{0, 4, 2, 7, 4, 9}];
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}]

How can I center the figure "a" ?

Thank you.

$\endgroup$
4
  • $\begingroup$ Hi! Is there a difference to your previous question? $\endgroup$
    – Yves Klett
    Commented Jun 23, 2015 at 18:22
  • $\begingroup$ @Yves Klett It is all related. Now is further issues related to the same problem I am attacking. $\endgroup$
    – Mencia
    Commented Jun 23, 2015 at 18:24
  • 2
    $\begingroup$ What do you mean by center? The figure "a" is defined by the points in your ListPlot3D. You can change your Polygon so the figure "a" will take all space in XY plane: Show[{Graphics3D[{EdgeForm[], {Texture[b], Polygon[{{0, 0, 0}, {1, 0, 0}, {1, 1, 0}, {0, 1, 0}}, VertexTextureCoordinates -> {{0, 0}, {1, 0}, {1, 1}, {0, 1}}]}}, Axes -> True], a}] $\endgroup$
    – BlacKow
    Commented Jun 23, 2015 at 18:30
  • $\begingroup$ @BlacKow thank very much, that solves it. I have a further problem. I want the background of the ListLinePlot to be white. In order to do that I do Show[{Graphics3D[{EdgeForm[], {Texture[b], Polygon[{{0, 0, 0}, {1, 0, 0}, {1, 1, 0}, {0, 1, 0}}, VertexTextureCoordinates -> {{0, 0}, {1, 0}, {1, 1}, {0, 1}}]}}, Axes -> True, Lighting -> "Neutral"], a}] . But then, the figure "a" also becomes white. How can I fix that? $\endgroup$
    – Mencia
    Commented Jun 23, 2015 at 18:42

1 Answer 1

1
$\begingroup$

I'm not sure what exactly you trying to achieve by using the 2D plot as a Texture. The following code gives me white background:

a = ListPlot3D[{{0, 0, 3}, {0, 1, 3}, {1, 0, 3}, {1, 1, 3}, {0.25, 
     0.5, 1}, {0.75, 0.5, 1}}];
b = ListLinePlot[{0, 4, 2, 7, 4, 9}];
Show[{Graphics3D[{EdgeForm[], {Texture[b], Blue, 
     Polygon[{{0, 0, 0}, {1, 0, 0}, {1, 1, 0}, {0, 1, 0}}, 
      VertexTextureCoordinates -> {{0, 0}, {1, 0}, {1, 1}, {0, 1}}]}},
    Lighting -> "Neutral", Axes -> True], a}]

enter image description here

Lighting -> {{"Ambient", White}} is another way to make your polygon white.

Although you should probably consider plotting your figure "b" in 3D instead of mapping it as a texture.

$\endgroup$
8
  • $\begingroup$ I am using Mathematica 9, in my case the figure b also becomes white using Lighting -> "Neutral" $\endgroup$
    – Mencia
    Commented Jun 23, 2015 at 19:06
  • $\begingroup$ Try to change Lighting in your ListPlot3D too? E.g Lighting -> {{"Ambient", LightBlue}} I don't have have V9, so I can't test it. $\endgroup$
    – BlacKow
    Commented Jun 23, 2015 at 19:10
  • $\begingroup$ Ok, I will open a new question to solve this issue. Thank very much! $\endgroup$
    – Mencia
    Commented Jun 23, 2015 at 19:12
  • $\begingroup$ Consider telling us the final goal of your visualization. Community can come up with more elegant solutions rather than using Texture $\endgroup$
    – BlacKow
    Commented Jun 23, 2015 at 19:14
  • $\begingroup$ @Mr.Wizard♦ suggested that I should use Texture , in a comment under PlatoManiac's answer in this post: mathematica.stackexchange.com/questions/3665/… $\endgroup$
    – Mencia
    Commented Jun 23, 2015 at 19:16

Your Answer

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

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