# How can I slice one plane from a VectorPlot3D to get a stream plot?

I am analyzing a system of ODEs in three equations/three variables, and I have a linearized system $$\begin{bmatrix} x' \\ y' \\ z' \end{bmatrix} = \begin{bmatrix} -1 & -1 & 0 \\ 0 & 2 & 0 \\ 0 & 0 & 1 \end{bmatrix} \begin{bmatrix} x \\ y \\ z\end{bmatrix}.$$

I have plotted this in 3D using VectorPlot3D and I would like to get slices, i.e., stream plot representations of the XY, XZ, and YZ planes. If the equations were completely decoupled I would just make three separate plots using the StreamPlot -- however, the equations for $$x'$$ and $$y'$$ are only partially decoupled, so I am not sure how to get a 2-Dimensional stream plot on the XZ plane, as I can only specify two variables.

So, is there a way to input my 3D vector field equations and get out 2D slices on certain planes? I think I can do this using either the ViewPoint or ViewProjection options, but I am not sure how to use them.

Here is my VectorPlot3D code for reference.

VectorPlot3D[{-x - y, 2 y, z}, {x, 0.0, 1.2}, {y, 0.0, 1.2}, {z, 0.0, 1.2},
Axes -> True,
AxesLabel ->
{Style["x", Bold, FontSize -> 24], Style["y", Bold, FontSize -> 24],
Style["z", Bold, FontSize -> 24]},
VectorColorFunction -> "Rainbow",
VectorPoints -> 5,
VectorScale -> {0.1, .7, None}]


## 3 Answers

Well, for starters, the $$x$$ and $$y$$ solutions are independent of $$z$$. Also, I understand there is symmetry, but it is helpful to plot the negative values of the variables, as well (since $$(x>0,y<0) \textrm{ or } (x<0,y>0)$$ has different behavior than both negative or both positive:

StreamPlot[{-x - y, 2 y}, {x, -1.2, 1.2}, {y, -1.2, 1.2}, Axes -> False,
FrameLabel -> {Style["x", Bold, FontSize -> 24], Style["y", Bold, FontSize -> 24]}, StreamColorFunction -> "Rainbow",
StreamScale -> {0.1, .7, None}] Here is a view looking at the $$xz$$-plane, with your code and very minor adjustments,

 VectorPlot3D[{-x - y, 2 y, z}, {x, -1.2, 1.2}, {y, -1.2, 1.2}, {z, -1.2, 1.2},
AxesLabel -> {Style["x", Bold, FontSize -> 24], Style["y", Bold, FontSize -> 24],
Style["z", Bold, FontSize -> 24]},
VectorColorFunction -> "Rainbow", VectorPoints -> 5,
VectorScale -> {0.1, .7, None}, ViewPoint -> Front]


The main "addition" is ViewPoint->Front, which I just looked up in the documentation. • Well, this doesn't really answer my question (how to plot the XZ plane of the 3D field). But I figured that out. However, I feel like I should say--I am aware of the behavior of the point already, I was just trying to get some good visualization images. The eigenvalues of the matrix reflect that the point is a saddle, and for the problem I am modeling, negative values are not allowed as inputs--I should have stated this in the question but I did not think it was relevant. – jeanquilt Mar 31 at 21:11
• Okay, I did not mean to presume anything about what you already know about the problem. It seems to me that you fully understand the problem, and are exploring how to use Mathematica. Did you use viewpoint, or something else? Okay, I see your answer posted. Yes, "negative values not allowed" is relevant, mostly because to attempt an answer, we could only guess at information not provided. – mjw Mar 31 at 21:22

I realized that the definition of the XZ plane is that $$y=0$$ for all coordinates lying on the plane. So, I can plot the XZ plane as StreamPlot[{-x, z}, {x, 0, 1.2}, {z, 0, 1.2}]. And this is exactly the same as taking a slice of the 3D vector field.

SliceVectorPlot3D[{-x - y, 2 y, z},
"CenterPlanes",
{x, -2, 2}, {y, -2, 2}, {z, -2, 2}] or

SliceVectorPlot3D[{-x - y, 2 y, z},
"ZStackedPlanes",
{x, -2, 2}, {y, -2, 2}, {z, -2, 2}] or....

SliceVectorPlot3D[{-x - y, 2 y, z},
InfinitePlane[{{0, 0, 0}, {0, 1, 0}, {1, 0, 0}}],
{x, -2, 2}, {y, -2, 2}, {z, -2, 2}]
` 