Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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

I want to add a quarter circle to delimit the evolution of the 2D CA with code 746 (which is almost circular) like it's shown here

I tried what's shown below, but I can't get the Epilog to show, why?

Manipulate[ ArrayPlot[
  (ca = CellularAutomaton[
      {746, {2, {{2, 2, 2}, {2, 1, 2}, {2, 2, 2}}}, {1, 1}},
      {Table[1, {5}, {1}], 0}, {{{steps}}}])
   [[1 ;; Floor[Dimensions[ca][[1]]/2], 
    Floor[Dimensions[ca][[2]]/2] ;; -1 ]]
  ,

  ImageSize -> {460, 330}, Frame -> False, 
  Epilog -> {Circle[{0, 0}, 1, {0, Pi/2}]}], {{steps, 100}, 1, 1000, 
  1, Appearance -> "Labeled"}]
share|improve this question
up vote 3 down vote accepted

Try this:

Manipulate[
 ArrayPlot[(ca = 
     CellularAutomaton[{746, {2, {{2, 2, 2}, {2, 1, 2}, {2, 2, 
          2}}}, {1, 1}}, {Table[1, {5}, {1}], 0}, {{{steps}}}])[[1 ;; 
     Floor[Dimensions[ca][[1]]/2], 
    Floor[Dimensions[ca][[2]]/2] ;; -1]], ImageSize -> {460, 330}, 
  Frame -> False, AspectRatio -> 1, 
  Epilog -> {Red, Thick, 
    Circle[{0, 0}, Scaled[1], {0, Pi/2}]}], {{steps, 100}, 1, 1000, 1,
   Appearance -> "Labeled"}]

circle

It shows the circle. The original radius was just not large enough on the scale of the plot. I replaced it by a scaled quantity so that it always extends to the end.

share|improve this answer

One can use the DataRange option of ArrayPlot.

Manipulate[
 ArrayPlot[
   (ca = CellularAutomaton[{746, {2, {{2, 2, 2}, {2, 1, 2}, {2, 2, 2}}}, {1, 1}},
      {Table[1, {5}, {1}], 0},
      {{{steps}}}])[[1 ;; Floor[Dimensions[ca][[1]]/2],
    Floor[Dimensions[ca][[2]]/2] ;; -1]],
  ImageSize -> {460, 330},
  DataRange -> {{0, 1}, {0, 1}},
  Frame -> False, 
  Epilog -> {Red, Circle[{0, 0}, 1, {0, Pi/2}]}], {{steps, 100}, 1, 
  1000, 1, Appearance -> "Labeled"},
 {ca, ControlType -> None}]

Mathematica graphics

share|improve this answer

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.