Skip to main content

Manipulate not showing anything


This works:


Manipulate[Plot[2*x + 3*y, {x, 3, 4}], {y, 3, 4}]


But this doesn't


f=2*x + 3*y
Manipulate[Plot[f, {x, 3, 4}], {y, 3, 4}]

My "f" is a painful long expression so I'd rather be able to get the latter method to work than work with the former.



Answer



Manipulate has to 'see' the that f depends on y, so define it as follows:


f[x_, y_] = 2*x + 3*y
Manipulate[Plot[f[x, y], {x, 3, 4}], {y, 3, 4}]


Mathematica graphics


By the way, this is mentioned in the "Possible Issues" section of the Manipulatedoc page.


Comments