How to Rescale the X-Axis in Mathematica?

  • Context: Mathematica 
  • Thread starter Thread starter olietc
  • Start date Start date
  • Tags Tags
    Mathematica
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
4 replies · 17K views
olietc
Messages
2
Reaction score
0
Hi guys
I am trying to plot a function with respect to T, but I want to rescale my axis.
For example my range right now shows 0, 10, 20, 30. But I want it to show 0, 1, 2, 3 and so that I can then put an x-axis label of T/10.
Can anyone help?
 
Physics news on Phys.org
Here's a function that has zeros at x=10 and x=20.
Code:
f[x_]:=(x-10)(x-20)
and it's normal plot
Code:
Plot[f[x],{x,0,30},AxesLabel->{x,f}]

Here's two different ways to change the x-axis units to x/10:
Code:
Plot[f[10x],{x,0,3},AxesLabel->{x/10,f}]
Code:
Plot[f[x],{x,0,30},Ticks->{Table[{i,i/10.},{i,0,30,5}],Automatic},AxesLabel->{x/10,f}]
 
Thanks so much!
I like that last option Simon_Tylor, it keeps the function the same. Up until now the only thing I could think of was changing the x inside the function like you did in your first example..
 
Not a problem olietc!