# Discontinuous lines in StreamPlot

I am trying to plot a vector field using the function StreamPlot:

StreamPlot[{0, rho (1 - rho) - j}, {j, 0, 1/3}, {rho, 0, 1},
Frame -> None, StreamPoints -> 100, StreamScale -> {0.3},
StreamStyle -> Green, StreamMarkers -> "PinDart"]


This vector field is essentially made of vertical lines. My problem is that Mathematica only seems to draw parts of these lines, while I would like them to be continuous and span the entire range on the vertical axis.

I have tried to use several graphical options for this command, but nothing seems to work. Any idea?

• Are you certain they are straight vertical lines? Some of the vectors are {0,0} so they will not be drawn. Have a look at ContourPlot[rho (1 - rho) - j, {j, 0, 1/3}, {rho, 0, 1}] to see that the varying values in the vertical plane. Mar 23, 2020 at 11:11
• I'm voting to close this question as off-topic because zero length vectors are not drawn on StreamPlot. Mar 23, 2020 at 11:13
• tried StreamScale -> Full?
– kglr
Mar 23, 2020 at 11:14
• I am aware that there are points where the flow is (0,0), and I do not expect Mathematica to produce a plot for them (I apologize if this was not clear before). What I would expect is for the lines to be defined above/below these points, instead of on one side only. I have tried StreamScale->Full, but it does not work :/ Mar 23, 2020 at 11:20
• Show an image of what you get. I get stream lines throughout the plotting domain: i.stack.imgur.com/wJWnQ.png Mar 23, 2020 at 11:40

Define explicit starting points for streamlines.

pts = Flatten[Table[{{j, 1/2}, {j, 0}, {j, 1}}, {j, 0, 1/3, 1/30}], 1];

sp = StreamPlot[{0, rho (1 - rho) - j}, {j, 0, 1/3}, {rho, 0, 1},
StreamPoints -> pts, StreamScale -> {0.3}, StreamStyle -> Green];

cp = ContourPlot[0 == rho (1 - rho) - j, {j, 0, 1/3}, {rho, 0, 1}];

Show[cp, sp]


• This is exactly what I meant, thank you! :) Mar 23, 2020 at 13:08