How to Rescale the Horizontal Axis in Mathematica?

  • Context: Mathematica 
  • Thread starter Thread starter Anna Kaladze
  • Start date Start date
  • Tags Tags
    Axis Mathematica
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
2 replies · 4K views
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