PDA

View Full Version : Changing x-axis in Mathematica


olietc
Oct1-10, 11:33 PM
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?

radou
Oct2-10, 03:34 AM
Try with:

Plot[function, {x, 0, 3}, AxesLabel -> {T/10, y-label}]

Simon_Tyler
Oct2-10, 03:41 AM
Here's a function that has zeros at x=10 and x=20.
f[x_]:=(x-10)(x-20)
and it's normal plot
Plot[f[x],{x,0,30},AxesLabel->{x,f}]

Here's two different ways to change the x-axis units to x/10:
Plot[f[10x],{x,0,3},AxesLabel->{x/10,f}]
Plot[f[x],{x,0,30},Ticks->{Table[{i,i/10.},{i,0,30,5}],Automatic},AxesLabel->{x/10,f}]

olietc
Oct2-10, 10:30 AM
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..

Simon_Tyler
Oct3-10, 04:45 AM
Not a problem olietc!