# How to make a 1D VectorPlot

I am trying to use VectorPlot to produce a 1 dimensional vector plot. I Have tried using VectorPoints->{10,1} but it produces an error as it wants at least 2 in each direction. Is there a way to make such a plot? For example:

d = 3;
n = 3;
k = 1;
c = Sqrt[(d-2)/(k(n-2))];
Show[
VectorPlot[{-(d-2)+(n-2) k x^2, 0}, {x,0,3}, {y,-0.1,0.1}, VectorPoints -> {20, 3}, AspectRatio -> 1/5, ImageSize -> Large, StreamPoints -> 20],
Graphics[{Red, Line[{{c,-1}, {c, 1}}]}]
]


But I only want a single line of vectors, and I'd like to clear up the StreamPoints to look nicer somehow. Perhaps it would be nice if the vectors were on one line and the stream lines below or something like that. I'm open to suggestions.

• What is a 1D vector plot? Can you point to one on the web? Commented Mar 15, 2019 at 21:47
• @DavidG.Stork I added an example
– Kai
Commented Mar 15, 2019 at 21:56

Specify the actual points instead of how many:

Block[{d = 3, n = 3, k = 1, c},
c = Sqrt[(d - 2)/(k (n - 2))];

Show[
VectorPlot[{-(d - 2) + (n - 2) k x^2, 0}, {x, 0, 3}, {y, -0.1,
0.1},
VectorPoints -> Table[{x, 0}, {x, 0, 3, 3./12}],
AspectRatio -> 1/5, ImageSize -> Large],
Graphics[{Red, Line[{{c, -1}, {c, 1}}]}]]
]


• Perfect! Thanks a bunch
– Kai
Commented Mar 15, 2019 at 22:31
    Graphics[Table[
Arrow[{{i, 0}, {i, 0} + {RandomReal[], 0}}],
{i, 1, 10, .5}]]


or for greater visibility:

Graphics[Table[{Hue[RandomReal[]],
Arrow[{{i, 0}, {i, 0} + {3 RandomReal[], 0}}]},
{i, 1, 20, 2}]]