# How to transform frame ticks from 1, 2, 3, … to x, 2 x, 3 x, …?

I want to replace the numbers on a framed plot's axes with that number multiplied by a variable, call it x. (The idea is that I'm plotting things which depend on some scale, and I want to show that on the axes, i.e. that I'm plotting these functions with x divided out.)

Here's a minimal example that I've written up:

Plot[a, {a, 0, 1},
Frame -> True,
FrameTicks ->
{{Partition[Riffle[Range[0, 1, 0.2], (Range[0, 1, 1/5] /. x_Rational :> N[x]) x], 2], None},
{Automatic, None}}]


It does the trick, but the problem is that I need to adjust it each time I change the plot range. What I do is plot the function without the FrameTicks, see which numbers are plotted on the y-axis, and adjust the range accordingly. Is there a way to automate that process?

• Something like this? So you change the range only once.. :) – Öskå Jul 19 '14 at 11:38
• Closely related: (5369) – Mr.Wizard Jul 19 '14 at 12:52