Change the location of a text in a plot
조회 수: 4 (최근 30일)
이전 댓글 표시
I have a simple problem which is taking a lot of time. I have 2 texts (white and yellow) in a graph which overlap. How can I separate them? The code and plot is attached. Thank you in advance
if true
% font_size = 14;
Peak=text(0, font_size, ['Height (feet): ' num2str((length(Im)-min(y))*(8.5/470))], 'Color', 'white','FontSize',font_size);
Angle=text(0.5, font_size, ['Theta (degrees): ' num2str(theta)], 'Color', 'yellow','FontSize',font_size);
end
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/171663/image.jpeg)
댓글 수: 0
채택된 답변
Star Strider
2018년 3월 29일
Your text call is interpreting your ‘font_size’ variable as the y-coordinate.
The solution is to use different y-coordinates for each text call.
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Annotations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!