Question

I need to plot a few points in a graph and then write a comment next to each point. How can I do this?

I plotted the points like this

plot(5000,  211   , 'o')
hold on;
plot(5000,  100    , 'o')
plot(5000,  20     , 'o')

and then i need to write a comment next to each "o". I tried using the same method but it didn't work.

plot(5000,  215   , 'some comment')

How to solve this most easily?

Was it helpful?

Solution

Use something like that for that particular point (adapt spaces for your use)

text(5000, 211, '   some comment', 'FontSize',12)

To add arrows, use something like:

text(5000, 211, ' \leftarrow some comment', 'FontSize',12)

Also check the Matlab docs on annotating graphs.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top