2

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?

m_goldberg
  • 107,779
  • 16
  • 103
  • 257
Adam
  • 709
  • 6
  • 11

0 Answers0