# Vertical axis as function value

For a strictly increasing arbitrary function f[y], where y is the variable for the left hand side vertical axis(LHS) in the 2D plot, I wish to show its value using the vertical axis on the right hand side(RHS). (x will be the variable for the horizontal axis.)

As an example, I wish to show the value of f[y=1] using the coordinate value of the RHS vertical axis, and it should be ticked on the same height as y=1 in the LHS vertical axis.

Since f[y] will be an arbitrary function, its increasing rate will be arbitrary, and therefore the scale for the RHS vertical axis will not be uniform.

I have seen some examples where the scale for the RHS vertical axis is uniform, just like the LHS vertical axis. But I couldn't find any examples stated above. I want to ask if this type of plotting is achievable in Mathematica.

Is something like the following what you're looking for?

Plot[
10 Sin[x],
{x,0,Pi},
Frame->True,
FrameTicks->{
{Automatic, ChartingScaledTicks[{Sqrt[#]&, #^2&}]},
{Automatic, None}
}
]


• Dear Carl, thank you for the answer! Yes this is what I am looking for, although I am not familiar with ChartingScaledTicks at the moment. The example you kindly demonstrated is for f[y]=y^2. Is this type of plotting possible for any type of strictly increasing f[y], e.g., even for functions that are defined piece wise using Heaviside-theta functions that shows completely different behaviors depending on the y axis value? – Gould67 Jan 25 '18 at 6:40
• I see. As long as I have numerically "good" definition of the inverse function, it works. Thank you! – Gould67 Jan 25 '18 at 9:38

If you do not want to frame your plot, and as sometimes it could be difficult to use undocumented functions, you can use AxesOrigin and custom Ticks:

ticks[xmin_, xmax_] := Table[{i, NumberForm[Sqrt[i], {2, 2}]}, {i, xmin, xmax}];
pl = Plot[10 Sin[x], {x, 0, Pi}, PlotRange -> {0, 10}, AxesOrigin -> {Pi + 0.2, 0.},
Ticks -> {Automatic, ticks}]


You can even modify the ticks marks if you do not want to they point outwards.

Or by using Frame but removing those unwanted axes:

ticks[xmin_, xmax_] := Table[{i, NumberForm[Sqrt[i], {2, 2}], {0, 0.005}}, {i, xmin, xmax}];
Plot[10 Sin[x], {x, 0, Pi}, PlotRange -> {{0, \[Pi] + 0.2}, {0, 10}},
Frame -> {{False, True}, {True, False}}, Axes -> False,
FrameTicks -> {{None, ticks}, {Automatic, None}}]