Group Abstract Group Abstract

Message Boards Message Boards

Bad but Short Mathematica Programs

Posted 8 years ago
POSTED BY: Ed Pegg
3 Replies

Not using "nested Dynamics":

Manipulate[
  ContourPlot[Sin[5 x] Cos[7 y], {x, y} \[Element] Rectangle[],  
    Epilog -> {AbsolutePointSize@12, Point[t {1, 1}]}
  ],
  {t, 0, 1}
]

vs

Manipulate[
  ContourPlot[Sin[5 x] Cos[7 y], {x, y} \[Element] Rectangle[], 
    Epilog -> {AbsolutePointSize@12, Point[Dynamic[t] {1, 1}]}
  ],
  {t, 0, 1}
]

The second one is much smoother because the FrontEnd does not need to care about anything but t, when for the first case the whole ContourPlot is recalculated.

POSTED BY: Kuba Podkalicki
Posted 8 years ago

Both examples look the same to me. What am I missing?

POSTED BY: Updating Name

You are right, corrected.

POSTED BY: Kuba Podkalicki
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard