# Scaling the axis

I want to scale the x-axis in the plot by a factor of $\frac{\sqrt{3}}{2}$, When I change the variable in the command:

Plot[f,{Sqrt[3]r/2,0,20}]


I am getting an error as "tag Times in $\frac{\sqrt{3}r}{2}$ is protected"

How to remove this problem?

• You try to scale the iterator - that doesn't work. Scale the function argument instead... – Yves Klett Apr 21 '16 at 19:01
• That changes the entire problem itself. – vbj Apr 21 '16 at 19:02
• you could scale the x-axis with this: How to assign arbitrary values to frameaxis of a ListDensityPlot – Kay Apr 21 '16 at 19:05
• maybe ParametricPlot[{Sqrt[3]r/2,f[r]},{r,0,20}] – george2079 Apr 21 '16 at 19:07
• @george2079, I used the command suggested but I am not sure whether this corresponds to the problem or not. I will state the problem, $r$ is along horizontal direction, whereas I have calculated the function along a line inclined at $\frac{\pi}{6}$, I want to plot the function along that inclined line. – vbj Apr 21 '16 at 19:32

You could use ReplaceAll (/.) to introduce a scaled variable to plot over.

For example, assuming f implicity depends on r, you could introduce rscaled:

f := Sin[r] + r; (* Example function *)
Plot[f, {r, 0, 20 2/Sqrt[3]}] (* Original Plot *)
Plot[f /. r -> rscaled 2/Sqrt[3], {rscaled, 0, 20 }] (*Scaled Plot*)


Alternatively, it's simpler if r is an explicit argument. For example,

g[r_] := Sin[r] + r;
Plot[g[rscaled 2/Sqrt[3]], {rscaled, 0, 20 }]