Thread Subject: xaxis labels

Subject: xaxis labels

From: Abel Brown

Date: 13 Apr, 2008 18:08:01

Message: 1 of 6

my x axis right now is 7000 8000 9000 10000 11000 ... 16000

but matlab labels the x axis as 0.7 0.8 ..1.6 x10^4

is there a quick way to get matlab not to use this
exponential form for the tics?

Thanks!

Subject: xaxis labels

From: Élodie

Date: 13 Apr, 2008 18:30:55

Message: 2 of 6



figure(1)
x=[7000 8000 9000 10000 11000 16000];
y=x.^2;
plot(x,y)
set(get(1,'currentaxes'),'XTickLabel',[7000:1000:16000])


does it help you ?


--
Élodie Roux
www.elodieroux.com

Subject: xaxis labels

From: Abel Brown

Date: 13 Apr, 2008 18:50:03

Message: 3 of 6

"?lodie" <elodie.roux@ifrance.com> wrote in message
<480252db$0$24583$426a74cc@news.free.fr>...
>
>
> figure(1)
> x=[7000 8000 9000 10000 11000 16000];
> y=x.^2;
> plot(x,y)
> set(get(1,'currentaxes'),'XTickLabel',[7000:1000:16000])
>
>
> does it help you ?
>
>
> --
> ?lodie Roux
> www.elodieroux.com
>
>

I didn't want to have to force the "XTickLabel" since the x
axis is not always the same.

i just wanted to get MATLAB to stop using the exponential
form on the x axis

Subject: xaxis labels

From: Élodie

Date: 13 Apr, 2008 22:43:05

Message: 4 of 6

In this case, do (after you plot intruction)

set(get(1,'currentaxes'),'XTickLabel',get(get(1,'currentaxes'),'XTick'))

it will get the x-axis values automatically computed by Matlab during the
plot,
and it will display the XtickLabel without doing things like 10^4

_________________________________________________________
figure(1)
x=[7000 8000 9000 10000 11000 16000];
y=x.^2;
plot(x,y)

set(get(1,'currentaxes'),'XTickLabel',get(get(1,'currentaxes'),'XTick'))
 _________________________________________________________


is it better like that ?

--
Élodie Roux
www.elodieroux.com

Subject: xaxis labels

From: Abel Brown

Date: 14 Apr, 2008 12:24:02

Message: 5 of 6

"?lodie" <elodie.roux@ifrance.com> wrote in message
<48028df6$0$19392$426a74cc@news.free.fr>...
> In this case, do (after you plot intruction)
>
>
set(get(1,'currentaxes'),'XTickLabel',get(get(1,'currentaxes'),'XTick'))
>
> it will get the x-axis values automatically computed by
Matlab during the
> plot,
> and it will display the XtickLabel without doing things
like 10^4
>
> _________________________________________________________
> figure(1)
> x=[7000 8000 9000 10000 11000 16000];
> y=x.^2;
> plot(x,y)
>
>
set(get(1,'currentaxes'),'XTickLabel',get(get(1,'currentaxes'),'XTick'))
> _________________________________________________________
>
>
> is it better like that ?
>
> --
> ?lodie Roux
> www.elodieroux.com
>
>

Oh snap! that worked perfect! You're a genius! I never
would have figured that out!

Thanks x10!!!!

Subject: xaxis labels

From: Élodie

Date: 14 Apr, 2008 15:23:13

Message: 6 of 6

you're welcome !


--
Élodie Roux
www.elodieroux.com

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
x axis x labels... Abel Brown 13 Apr, 2008 14:10:04
rssFeed for this Thread

Contact us at files@mathworks.com