필터 지우기
필터 지우기

aligning text in plots

조회 수: 208 (최근 30일)
harley
harley 2013년 8월 7일
댓글: SB 2021년 3월 16일
how do i move the point label so its aligned right and higher
x = Vb_ev;
y = pH_ev;
plot(x,y,'ro'), text(Vb_ev, pH_ev,'point X')

채택된 답변

Jan
Jan 2013년 8월 7일
text(Vb_ev, pH_ev,'Point X', ...
'HorizontalAlignment', 'right', ...
'VerticalAlignment', 'bottom');
  댓글 수: 4
Jan
Jan 2013년 8월 7일
편집: Jan 2013년 8월 7일
See the documentation for all properties: http://www.mathworks.com/help/matlab/ref/text_props.html. You need to set the "Color" property.

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

추가 답변 (2개)

Suman Saha
Suman Saha 2013년 8월 7일
clear all;clc;close all;
x=1:10;y=1:10;
plot(x,y,'ro')
text([1:10]-1.5,[1:10]+1,'Point X')
axis([-1 12 -1 12])

David Sanchez
David Sanchez 2013년 8월 7일
It depends on your plotted data.
text(x,y,'your_text')
will draw your_text in the position (x,y) within your figure. To draw text in upper right corner of your plot,
x = max(x_variable);
y = max(y_variable);
But bear in mind to subtract something from those values in order to place the text within the plot, otherwise it'll be printed just in the top-right corner and you won't be able to see it. For example:
x = max(x_variable)-10;% adapt the subtracted value to your needs
y = max(y_variable)-10;
  댓글 수: 1
harley
harley 2013년 8월 7일
so for that edited above how do i applying these positioning commands

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

카테고리

Help CenterFile Exchange에서 Labels and Annotations에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by