Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When I do a StreamPlotof a rather complicated pair of differential equations, it loses some details.

For example:

StreamPlot[{Tan[y - x], 2^y - 2 Cos[Pi/3 - x]}, {x, -4, 4}, {y, -4, 4}] 

Here is the result:

enter image description here

Is there any way to:

  • Change the color near each of the critical points to a different set of colors?

  • Increase the level of detail near the saddle points and spirals? That is, add more streams?

  • Any way to make a collage (for example, a landscape variant in order to capture more of the rich details and global behaviors of all critical points, including the periodic ones in this particular example)?

share|improve this question
Look here Basins of Attraction – Artes Sep 25 '13 at 21:36
@Artes: Thanks for the nice link! Regards – Amzoti Sep 25 '13 at 23:49
up vote 14 down vote accepted

There are a lot of options in StreamPlot. For example, you can do the following

StreamPlot[{Tan[y - x], 2^y - 2 Cos[Pi/3 - x]}, {x, -Pi, Pi}, {y, -4, 4}, 
   StreamPoints -> {{200, {{1, 0}, {Red, Thick}}, {{0, -3}, {Blue, Thick}}}, 0.1, 10}, 
   StreamScale -> {0.10, 100, 0.006},
   PlotRange -> {{-Pi, 3 Pi}, {-4, 4}}, AspectRatio -> 0.5, ImageSize -> 600] /. 
  Arrow[p_] :> {Arrow[p], Arrow@Transpose[{2 Pi, 0} + Transpose[p]]}

enter image description here

Here 200 is the whole number of the streams, {1,0} and {0,-3} are the reference points for the highlighted streams, 0.1 is a minimal distance between the streams, 10 is a maximum lengths of the streams, 0.10 is the lengths of the arrows, 100 is the number of points to represent the arrows, 0.006 is the size of the heads of the arrows, {2 Pi, 0} is the translation vector for the streams duplication.

share|improve this answer

Your Answer


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.