Mathematica How to Rescale the Horizontal Axis in Mathematica?

  • Thread starter Thread starter Anna Kaladze
  • Start date Start date
  • Tags Tags
    Axis Mathematica
AI Thread Summary
To rescale the horizontal axis of a Mathematica plot while keeping the function values unchanged, the discussion suggests modifying the function input. One approach is to redefine the function as f[x_] := x^2 + 3*x - 1 and plot it over a new range, such as {x, -5, 5}. To specifically shift the horizontal axis, the command Plot[f[x - 25], {x, 25, 35}] is recommended. This effectively adjusts the x-values while maintaining the original function's output. Additionally, using custom ticks with the Ticks option allows for precise control over the displayed axis values, ensuring clarity in the graph's representation.
Anna Kaladze
Messages
34
Reaction score
0
Hi All,

I have some simple Mathematica commands:

f[x_]=x^2+3*x-1

Plot[f[x],{x,0,10}]

Now, I need to "rescale" the horizontal axis of the resulting graph, so that number 25 is added to its value (i.e., the horizontal axis would take the starting value 25 (in place of 0) and 35 (in place of 10), and everything in between similarly. I do not want the position/value of the f[x] itself change. How do I achieve that?

Thanks a lot.

Anna.
 
Physics news on Phys.org
I am guessing a little bit here about what you want.

Try this
f[x_]:=x^2+3*x-1;Plot[f[x],{x,-5,5}]

Then try this
Plot[f[x],{x,-5,5},Ticks->{{{-4,21},{-2,23},{2,27},{4,29}},Automatic}]

and see if that is what you are asking for
 
Try:
Plot[f[x-25],{x,25,35}]
 

Similar threads

Back
Top