8
$\begingroup$

I'd like to draw

Plot[Re@Sin[x+I*2], {x, -10, 10}]

as an epilog on

Plot3D[Re@Sin[x + I*y], {x, -10, 10}, {y, -10, 10}]

and position it at y=2.

What's intuitive to me doesn't work:

epilogData = Table[{x, 2, Re@Sin[x + 2*I]}, {x, -10, 10, 0.1}];

Plot3D[Re@Sin[x + I*y], {x, -10, 10}, {y, -10, 10}, 
 Epilog -> {Red, PointSize[Large], Point[epilogData]}]

Using

epilogData2D = Table[{x, Re@Sin[x + 2*I]}, {x, -10, 10, 0.1}];

will draws something, but not what i want (What's that anyway?).

I've also played with Inset and got no luck so far.

$\endgroup$
1

3 Answers 3

10
$\begingroup$

Maybe it helps to use Mesh:

Plot3D[Re@Sin[x + I*y], {x, -10, 10}, {y, -10, 10}, 
  Mesh -> {{{0, None}}, {{2, {Red, Thick}}}}]

Plot3D with mesh

With a varying y:

frames = Table[
  Plot3D[Re@Sin[x + I*y], {x, -10, 10}, {y, -10, 10}, 
  Mesh -> {{{0, None}}, {{i, {Red, Thick}}}}], {i, -10, 10, .5}];
Export["animation.gif", frames]

enter image description here

$\endgroup$
2
  • $\begingroup$ How to make the animation? $\endgroup$
    – user13253
    Commented Oct 27, 2012 at 16:09
  • $\begingroup$ @MonkeyKing See update. $\endgroup$
    – VLC
    Commented Oct 27, 2012 at 16:33
3
$\begingroup$

Like this?

With[{y0 = 2}, 
     Show[Plot3D[Re@Sin[x + I*y], {x, -10, 10}, {y, -10, 10}], 
          Graphics3D[{AbsoluteThickness[4], 
                      First[Plot[Re@Sin[x + I y0], {x, -10, 10}]] /.
                      v : {__?NumericQ} :> Insert[v, y0, 2]}]]]

surface with marked line

The use of Mesh, as in VLC's answer, is much easier, tho.

$\endgroup$
1
$\begingroup$

Mesh as in VLC's answer is my favorite approach. Nevertheless, you can also use Exclusions and ExclusionsStyle:

Plot3D[Re@Sin[x + I*y], {x, -10, 10}, {y, -10, 10}, Mesh -> None, 
 Exclusions -> {Automatic, y == 2}, 
 ExclusionsStyle -> Directive[Opacity[1], Red, Thick]]

enter image description here

$\endgroup$

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.