How to prevent overlapping of point values on a matlab plot?

I want to display values of two points fairly close to each other, when I do that, there values appear to be overlapping each other and i have to zoom in to read each value. Is there a simple way to prevent this overlap, such that the points concerned are shown where they are but there values are just apart enough to be legible.

댓글 수: 4

How many points you have?
There is a submission on the FEX that lets you put multiple annotations in a plot, making sure they don't overlap. Is that what you need? If so, I could try to find it for you.
Thank you guys so much for trying to help me! It turns out my prof doesn't want the points after all.

댓글을 달려면 로그인하십시오.

 채택된 답변

Joseph Cheng
Joseph Cheng 2017년 3월 31일
why not put it in a legend if there are so few points
points=[1 1.01;1 1];
figure,plot(points(1,1),points(1,2),'x',points(2,1),points(2,2),'o')
xlim([0 2])
ylim([0 2])
for ind = 1:size(points,2)
ltext{ind} = ['(' num2str(points(ind,1)) ',' num2str(points(ind,2)) ')'];
end
legend(ltext)

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Annotations에 대해 자세히 알아보기

질문:

2017년 3월 23일

댓글:

2017년 4월 1일

Community Treasure Hunt

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

Start Hunting!

Translated by