1
$\begingroup$

I am trying to combine ListPointPlot and ListPointPlot3D together using Show. Unfortunately, Show does the plot, but displays the default views.

data1 = Table[Sin[2*x], {x, -2, 2, 0.1}];
data2 = Table[Sin[2*x] + Cos[4*y] + Sin[x*y], {x, -2, 2, 0.1}, {y, -2, 2, 0.1}];

figure1 = ListPlot[data1, Joined->True]
figure2 = ListPlot3D[data2, Mesh->None]

This is the code I thought might trick show into doing what I want. I am attempting to plot 2D and 3D together by placing the 2D plot as a layer on top of the 3D plot

figure4 = 
  ListPlot[data1, Joined -> True, ViewPoint -> Top, BoxRatios -> {1, 1, 0.5}]
figure5 = 
  ListPlot3D[data2, Mesh -> None, ViewPoint -> Right, BoxRatios ->{0.01, 1, 1}]
Show[figure4, figure5]

Unfortunately, this method does not work. The result shows that I have to rotate Table of data1 such that the values of z-x axis are in y-x. Transpose works in z-x and z-y axis but not in y-x axis (for data1). How do I fix that?

Notes:

  1. The data's are for illustration purpose only. The original are too complicated.

  2. Mathematica v.9

$\endgroup$
  • 1
    $\begingroup$ you mean something like this or this? $\endgroup$ – kglr Jul 2 '17 at 21:35
  • $\begingroup$ .. or this? $\endgroup$ – kglr Jul 2 '17 at 22:22
  • 1
    $\begingroup$ I'd convert them both to 3D graphics primitives and display them exactly as you like in Graphics3D. $\endgroup$ – Nicholas G Jul 2 '17 at 22:36
  • $\begingroup$ @kglr, Your asked like this (1) or this (2) or this(3).....More like (2) and (3) with transparent background of sin. $\endgroup$ – Aschoolar Jul 2 '17 at 23:32
  • $\begingroup$ Aschoolar, posted the code that produced (3) as an answer. $\endgroup$ – kglr Jul 2 '17 at 23:43
2
$\begingroup$
figure1 = ListPlot[data1, Joined->True,  PlotStyle-> {Thick, Red}, DataRange->{-2, 2}];
figure1b =  Graphics3D[{figure1[[1]] /. Line[x_] :> Line[ArrayPad[x, {{0}, {0, 1}}, 3]]}];
figure2 = ListPlot3D[data2, Mesh -> None, DataRange -> {{-2, 2}, {-2, 2}}];

Show[figure1b, figure2, Axes -> True, BoxRatios -> 1]

Mathematica graphics

$\endgroup$
  • $\begingroup$ ,Can you please give some clue on how to manipulate ranges and rotation. In my actual data for 3D, Show works only if figure2 DataRange is set in Automatic mode $\endgroup$ – Aschoolar Jul 3 '17 at 3:42
  • $\begingroup$ @Aschoolar, could you post a small example your actual data? $\endgroup$ – kglr Jul 3 '17 at 9:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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