How to change units of Y axis?

I made an histogram (left one) and I want to change the y axis units so it will be like the histogram on the right.
How can I do it?
thank's!

 Akzeptierte Antwort

Azzi Abdelmalek
Azzi Abdelmalek am 27 Mär. 2013
Bearbeitet: Azzi Abdelmalek am 27 Mär. 2013

1 Stimme

Edit
yt=(0:0.4:1.2)*10^4
set(gca,'yticklabel',xt)

5 Kommentare

googo
googo am 27 Mär. 2013
Bearbeitet: googo am 27 Mär. 2013
how exactly should I enter this? very new at matlab, don't know the set function. before the plot function?
After the plot:
yt=get(gca,'ytick')
yt1=linspace(0,1.2*10^4,numel(yt))
set(gca,'yticklabel',yt1)
googo
googo am 27 Mär. 2013
well, i get 1333, 2667,4000,5333 on the y axis. Any reason for that?
Azzi Abdelmalek
Azzi Abdelmalek am 27 Mär. 2013
Bearbeitet: Azzi Abdelmalek am 27 Mär. 2013
have you copied the above code?
googo
googo am 27 Mär. 2013
Yes, after the plot function.
well, now I asked my teacher and i'm not allowed using set and linspace so never mind about that.
As there any artificial way to do this? thank's!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Tags

Noch keine Tags eingegeben.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by