# Making the $y$-axis ticks on a plot be a function of a parameter

Sorry if the title is wordy. Basically, what I am asking would probably be easier if I just use an example.

Say I wanted to plot $f(x) = A\sin(x)$ and have the graph come up showing the sine function with the ticks on the $y$-axis being half-integer multiples of $A$. What I have been doing for my homework assignments is just plotting $f(x)=\sin(x)$ and then turning off the ticks and manually adding my own ticks. It would be really cool if Mathematica could do this for me.

• I think what you ended up doing is perhaps the best way... it isn't all that complicated either. – rm -rf Nov 13 '13 at 20:44
• What do you mean by manually? Are you using a custom tick specification as in this documentation example?: Plot[Cos[x], {x, 0, 10}, Ticks -> {{{Pi, 180 \[Degree], {0, .5}, Red}, {2 Pi, 360 \[Degree], {.5, 0}, Thick}, {3 Pi, 540 \[Degree], {0, .5}, Directive[Red, Dashed]}}, {-1, 1}}] – Mr.Wizard Nov 13 '13 at 20:48

See Ticks in the documentation:

Plot[Sin[x], {x, 0, 2 Pi},
Ticks -> {Automatic, Table[{y, Row[{y, " A"}]}, {y, -1, 1, 1/2}]}]


Unless you meant A to be a numeric value:

With[{A = Sqrt[2]},
Plot[A Sin[x], {x, 0, 2 Pi},
Ticks -> {Automatic, Range[-1, 1, 1/2] A}]
]


(OK, A = Sqrt[2] is a bit random. :)