Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

how to label y axis of a graph in horizontal manner

Asked by Sivakumaran Chandrasekaran on 10 May 2013

how to label y axis of a graph in horizontal manner... my output should be jan feb march

0 Comments

Sivakumaran Chandrasekaran

Tags

Products

3 Answers

Answer by Azzi Abdelmalek on 10 May 2013
Accepted answer

Example

y=[1 2 3 4];
plot(y),
set(gca,'ytick',y,'yticklabel',{'Jan','Feb','March','April'})

1 Comment

check if y=[1 2 4 3]; i am getting error

Azzi Abdelmalek
Answer by Azzi Abdelmalek on 10 May 2013

By default, y ticks are horizontal

1 Comment

jan

feb

march

i should get as like mentioned above

Azzi Abdelmalek
Answer by David Sanchez on 10 May 2013

Here you are:

ylabel({'jan';'feb';'march'},'Rotation',0)

1 Comment

how to increase space between jan and feb

David Sanchez

Contact us