Manipulate subtleties?
- To: mathgroup at smc.vnet.net
- Subject: [mg101318] Manipulate subtleties?
- From: AES <siegman at stanford.edu>
- Date: Wed, 1 Jul 2009 06:34:07 -0400 (EDT)
- Organization: Stanford University
If I type in (as three separate cells) makeFig := Graphics[{ Circle[{0,0}, 1], Circle[{0,0}, r]}]; Manipulate[ g1 = makeFig; Show[g1, ImageSize->1*72], {{r, 0.5}, 0,2}] Manipulate[ r = rc; (* rc short for "control variable" *) g1 = makeFig; Show[g1, ImageSize->1*72], {{rc, 0.5}, 0,2}] the second and third cells both produce Manipulate-type output cells that appear to be OK. The slider in the second cell output isn't active: Moving it doesn't cause anything to happen The slider in the third cell animates *both* cells. Reversing the order of the second and third cells gives the same behavior. Intriguing! If I change g1 to g2 in the third line, the second cell gives a Manipulate output cell with an error msg: "Radius r should be a positive number or pair of positive numbers, or a Scaled or Offset form." If I remove the initial values for the slider from both lines, the second line still gives an error but the third doesn't, apparently using 0 as the default value for rc (or does it use the 2nd value in {rc,0,1}?) Seems like the second line might have done the same for r? I guess my working rule from now on will be: "The control variable(s) of Manipulate slider(s) MUST appear explicitly in the body of a Manipulate definition." [But note that this is not logically necessary: Any intelligent human, presented with either the second or the third cell would have all the information needed to do what's desired.] Meta-question: _Where_ in the user documentation would the mythical "ordinary user" have been expected to learn that the second line wouldn't work?