Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I can't find anything anywhere on the web to help me with this.

My plot:

Plot[{(u (u + d) (1 - u))/u, u, 0}, {u, 0, 1}, 
 PlotStyle -> {Orange, Green, Green}, PlotRange -> {-0.1, 1}, 
 Frame -> True, Axes -> None, GridLines -> {{0}, {}}, 
 GridLinesStyle -> Directive[Green]]

I would like to be able to put vertical arrows on the orange lines and horizontal arrows horizontal arrows on the green curve.

If it helps, this is a plot of the nullclines of a system of ODEs and i need to draw the direction of the arrows of the vector field on each nullclines.

share|improve this question
    
please observe that you haven't defined "d". Which values do you want "d" to assume? –  eldo Jun 1 at 15:54

1 Answer 1

up vote 4 down vote accepted

Two alternatives:

Either post-process the output of Plot to modify the graphics primitives and directives:

 Plot[{(u (u + 2) (1 - u))/u, u, 0}, {u, 0, 1}, 
    PlotStyle -> {Orange, Green, Green}, PlotRange -> {-0.1, 1}, 
   Frame -> True, Axes -> None, GridLines -> {{0}, {}}, 
   GridLinesStyle ->  Directive[ Green]] /. 
         Line[x__] :> Sequence[Arrowheads -> Table[.025, {5}], Arrow[x]]

enter image description here

or, alternatively, use the following special setting for PlotStyle:

 Plot[{(u (u + 2) (1 - u))/u, u, 0}, {u, 0, 1}, 
  PlotStyle -> Thread[{{Orange, Green, Green}, 
                        Arrowheads[Table[.05, {5}]], (Arrow @@ ## &)}], 
     PlotRange -> {-0.1, 1}, Frame -> True, Axes -> None, 
     GridLines -> {{0}, {}}, GridLinesStyle -> Green]

Update: A simpler variant of the latter is using BaseStyle to change the default value for Arrowheads and post-process Lines into Arrows:

  Plot[{(u (u + 2) (1 - u))/u, u, 0}, {u, 0, 1}, 
   BaseStyle -> Arrowheads[Table[.05, {5}]], 
   PlotStyle -> {Orange, Green, Green}, PlotRange -> {-0.1, 1}, 
   Frame -> True, Axes -> None, GridLines -> {{0}, {}}, 
   GridLinesStyle -> Green] /. Line -> Arrow
share|improve this answer
    
Great! Just what I was looking for! –  user146338 Jun 1 at 16:04

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.