# Manipulate: SetterBar with list of functions

From the documentation:

Manipulate[Plot[f[x], {x, 0, 2 Pi}], {f, {Sin, Cos, Tan, Cot}}]


How do I include a function like $1/x$ or $x^2$, etc. in that list?

I (unsuccessfully) tried 1/# and #^2.

-
Maybe #^2 & -> x^2, 1/# & -> 1/x, as you also might want the labels for the pure functions? –  Pinguin Dirk Feb 1 '13 at 16:12
@PinguinDirk: ugh, I had forgotten my closing &. Thanks. If you post as an answer, I can accept. –  JohnD Feb 1 '13 at 16:18

As discussed in comments, here's a possible approach:

Manipulate[
Plot[f[x], {x, 0, 2 Pi}], {f, {Sin, Cos, Tan, Cot, #^2 & -> x^2,
1/# & -> "1/x"}, ControlType -> SetterBar}]


Which results in:

-

This works.

Manipulate[Plot[f[x],{x,0,2 Pi}],{f,{Sin[#]^2 &,#^2&,Cos,Tan,Cot}}]


David.

-