I want to create a graphics grid as in this example below, but for the manipulate example below and store that as a playable gif file. Is this possible (I would like to see each grid location running it's particular animation in unison)?

   Table[GraphPlot[Table[i -> Mod[i^p, m], {i, m}]], {m, 30, 33}, {p, 2,
    5}], Frame -> All]

$~~~~~~~~~~~~~~~~~~~~~~$enter image description here

Using the following (or any method that works), I want to step through each value of $\lambda$ (that is, set $\lambda = 10$, run the steps for $\mu \in (-5, 5)$ in the first grid location, then, $\lambda = 9$, run all the $\mu$ values again and put that in the second grid location, et. al. Note, the grid is likely $2~ by~ n$ so that it is easily viewable

A user can then view the changes in the system for varying the parameters and hopefully get a sense for any bifurcations that might be occurring in the system.

    StreamPlot[{1, -(x^3/(1 + x^2)) + \[Lambda] x^2 + \[Mu]}, {x, -8, 
    8}, {y, -8, 8}], {\[Lambda], -5, 5}, {\[Mu], -5, 5}]

$~~~~~~~~~~~~~~~~~~~~~~$enter image description here


1 Answer 1


Maybe this is what you want:

results = 
  Table[StreamPlot[{1, -(x^3/(1 + 
           x^2)) + λ x^2 + μ}, {x, -8, 8}, {y, -8, 8}, 
    PlotLabel -> 
     Framed[Row[{"λ \[LongEqual] ", λ, 
        ", μ \[LongEqual] ", μ}]], 
    ImageSize -> 160], {μ, -5, 5, 1}, {λ, 10, 1, -1}];

frames = Table[GraphicsGrid[Partition[r, 2]], {r, results}];

Export["frames.gif", Join[frames, Rest[Reverse[frames]]], 
 "DisplayDurations" -> .5]


Here I added the option "DisplayDurations" -> .5 to the Gif export so that the frames don't rush by too quickly. I also made the animation palindromic by going through the list frames in forward and reversed order. The variation in μ takes integer steps, and that may be too coarse. But if you add too many steps it will take longer to produce the frames and export them.

  • $\begingroup$ That is precisely the sort of solution I was looking for and am amazed at how short it is! I would change $\lambda$ to range from $\{\lambda, -5,5,1\}$, but other than that - spot on! $\endgroup$
    – Moo
    Commented Aug 8, 2016 at 4:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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