MATLAB Answers

0

how to write in the graph

Asked by Elysi Cochin on 22 Mar 2013

Is it possible to write something on a graph.... that is i plot a graph and in its x - axis it is image category.... i have 10 categories.... so i wanted to write in the graph what each category is.... can someone show me how to do it.... please do reply.....

  0 Comments

Tags

Products

No products are associated with this question.

2 Answers

Answer by Azzi Abdelmalek
on 22 Mar 2013
Edited by Azzi Abdelmalek
on 22 Mar 2013
 Accepted answer

You can use legend

  1 Comment

Example

   l={'Mountain','Seashore','A','B','Car'}
 plot(1:5,sin(1:5))
 set(gca,'xtick',1:5,'xticklabel',l)

Answer by Image Analyst
on 22 Mar 2013

You can also use text() if you want to write something that doesn't look like a legend. With text() you also specify the exact location where you want the text to appear.

  1 Comment

thank u sir...


Join the 15-year community celebration.

Play games and win prizes!

Learn more
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

MATLAB Academy

New to MATLAB?

Learn MATLAB today!