Message Boards Message Boards

0
|
6240 Views
|
4 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Problem with Surface plot plus a line

Dear Sir/Madam,

I have a small question regarding Mathematica plot. I am trying to plot two functions (one is a surface plot and another one is a 3d line) in 3D on the same plot (see the example in the attachment). The problem is in the combined plot, the line is not fully visible and becomes partly dashed. I wonder if there is any way to fix this problem.

Thanks in advance

Victor

Attachments:
POSTED BY: Victor Dykin
4 Replies

The appearance of dashing for your line is because the line is running alongside the surface in those places. As a consequence is it going in front of and behind the facets that comprise the plotted surface and thereby becoming obscured when behind the surface and visible when in front of it. To see this, if you add the Option

ContourStyle -> {Opacity[.5]}

to your ContourPlot3D for plot1, it will become apparent.

POSTED BY: David Reiss

Dear David,

Thanks a lot for your tips. My problem is that I dont want to change the "Opacity" (I want to keep it as it was specified on my plot). I wonder if there is any way around this problem, namely if one can make the plotted line appearing only in front of facets?

Victor

POSTED BY: Victor Dykin

It's kind of hard to avoid if, as I think is your case, the curve you are plotting is the intersection of another surface with your original surface. One possible approach (though this may be hard to implement consistently along the whole curve) is to add a small translation to the curve to move it away from the surface.

Here is a Manipulate using your expressions from your code to see how this might be done:

Manipulate[
 Show[plot1, plotadd /. z : Line[___] :> Translate[z, {0, a, 0}]],
 {{a, 0}, -3, 3}]
POSTED BY: David Reiss

Thanks David. I will test and we will see if I succeed with it

Victor

POSTED BY: Victor Dykin
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract