# Plot vectors as sums of vectors along the axes

in a phase diagram appear vectors that go in different directions. When graphing with the "streamplot" or "vectorplot" command, only the arrows appear showing how they move away from or closer to balance. Well, I would like to know how to divide a vector into two arrows that indicate how it grows on each axis "x" and "y". (i put in red that i need). Thanks :D Show[Plot[{(8 + x)/4, 1/2 (-3 - x)}, {x, -10, 10}],
StreamPlot[{-x + 4 y - 8, x + 2 y + 3}, {x, -10, 10}, {y, -6, 6},
StreamStyle -> LightCyan,
VectorPoints -> {{-10, 2}, {-5, 4}, {-5, -4}, {6, -3}},
VectorScale -> .15]]


You could use the Projection function here to good use. First make the StreamPlot:

sp = Show[Plot[{(8 + x)/4, 1/2 (-3 - x)}, {x, -10, 10}],
StreamPlot[{-x + 4 y - 8, x + 2 y + 3}, {x, -10, 10}, {y, -6, 6},
StreamStyle -> LightCyan,
VectorPoints -> {{-10, 2}, {-5, 4}, {-5, -4}, {6, -3}},
VectorScale -> .15, VectorMarkers -> Placed["Arrow", "Start"]]] Then make the projections:

vp = VectorPlot[{Projection[{-x + 4 y - 8, x + 2 y + 3}, {1, 0}],
Projection[{-x + 4 y - 8, x + 2 y + 3}, {0, 1}]}, {x, -10, 10}, {y, -6, 6},
VectorStyle -> Red,
VectorPoints -> {{-10, 2}, {-5, 4}, {-5, -4}, {6, -3}},
VectorScale -> .15, VectorMarkers -> Placed["Arrow", "Start"]] Of course you can style the vectors as you please. Then combine:

Show[sp, vp, PlotRange -> All] • When i put VectorMarkers -> Placed["Arrow", "Start"] returns error, can you help me? pls thax bro – Relayy ekko Jun 11 at 22:36
• @Relayyekko What version are you using? – chuy Jun 12 at 13:26

Using VectorPlot:

{f1, f2} = {(8 + x)/4, 1/2 (-3 - x)};
{gx, gy} = {-x + 4 y - 8, x + 2 y + 3};
Show[
Plot[{f1, f2}, {x, -10, 10}],

StreamPlot[{gx, gy}, {x, -10, 10}, {y, -6, 6}, StreamStyle -> Cyan],

VectorPlot[{{gx, gy}, {gx, 0}, {0, gy}}, {x, -10, 10}, {y, -6, 6},
VectorStyle -> {Black, Red, Blue},
VectorPoints -> {{-10, 2}, {-5, 4}, {-5, -4}, {6, -3}},
VectorScale -> .15,
VectorMarkers -> Placed["Arrow", "Start"]],

ImageSize -> 300, Frame -> True ] 