0
$\begingroup$

I am trying to cut a slice on z axis in a ContourPlot3d but I am unable to see any change in the slice plane. I am using the following code:

ySlice2 = ContourPlot3D[z == -1.5*10^-13, {x, 0, g}, {y, -2, 2}, {z,-1*10^-12, 0},ContourStyle -> Opacity[0.5, Lighter@Red], Mesh -> None, ImageSize -> Large, AspectRatio -> Full]

I need cut at different values of z axis and then later add this to other Plot3D using show. Please help.

Regards, Raghu

$\endgroup$
2
  • 3
    $\begingroup$ Use ClipPlanes. $\endgroup$
    – Roman
    Commented Jun 3, 2019 at 11:22
  • $\begingroup$ Can you please give me the code snippet to use ClipPlanes to cut z-axis? I see that ClipPlanes is used with Graphics3D but how can I fix the x,y and z ranges and then cut a plane at z = constant. $\endgroup$
    – Raghuram
    Commented Jun 4, 2019 at 5:09

1 Answer 1

2
$\begingroup$

Does this do what you want?

Manipulate[
  ContourPlot3D[x^2 + y^2 + z^2 == 1, {x, -1, 1}, {y, -1, 1}, {z, -1, 1}, 
    ClipPlanes -> InfinitePlane[{0, 0, Z}, {{0, 1, 0}, {1, 0, 0}}]],
  {{Z, 0}, -1, 1}]

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.