How do I label Lines

조회 수: 16 (최근 30일)
Kim Nguyen
Kim Nguyen 2013년 4월 12일
d=[.001:.001:.009,.01:.01:.09,.1:.1:.9,1:9,10:10:90,100:100:900,1000:1000:10000];
nd=numel(d); % number of lines created for displacement
f1=.0001;
f2=1000000;
hold on
for i =1:nd
pointd(1,:)=[f1,d(i)*2*pi*f1]; % first point
pointd(2,:)=[f2,d(i)*2*pi*f2]; % second point
xd=logspace(log10(pointd(1,2)),log10(pointd(2,2)));
yd=logspace(log10(f2),log10(f1));
plot(xd,yd,'color','black')
end
g=[.001:.001:.009,.01:.01:.09,.1:.1:.9,1:9,10:10:90,100:100:900,1000:1000:10000];
ng=numel(g);
for i =1:nd
pointg(1,:)=[f1,g(i)*386/(2*pi*f1)]; % first point
pointg(2,:)=[f2,g(i)*386/(2*pi*f2)]; % second point
xg=logspace(log10(pointg(1,2)),log10(pointg(2,2)));
yg=logspace(log10(f2),log10(f1));
plot(xg,yg,'color','black')
end
set(gca,'xscale','log')
set(gca,'yscale','log')
axis([1 10000 1 1000])
grid on
set(gca,'GridLineStyle','-')
Is a namograph i've created... How can is stick a label on the slanted lines to indicate their values? Or insert a label on the right hand side of the graph that is parallel to the lines? I do not want them to be horizontal or vertical for that would be too confusing. Also.. if Anyone knows a better way to make this namograph that input would be much appreciated. One more thing... in the last line i tried to make all my grid lines solid.... but this did not work.. it only did it on the major axis.
  댓글 수: 1
Kim Nguyen
Kim Nguyen 2013년 4월 12일
If anyone is looking at this, the best way i've found to get all my axis line to be solid and not doted was by following this post.
This worked well for my log graph

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

채택된 답변

Mahdi
Mahdi 2013년 4월 12일
Look at the text() matlab function. You can add a label at any point and you can even edit the label inside the figure window.
  댓글 수: 2
Kim Nguyen
Kim Nguyen 2013년 4월 12일
How do i edit the label inside the figure? I tried but it nothing is happening
Mahdi
Mahdi 2013년 4월 12일
Using the Edit Plot tool (pointer thing that looks like a mouse), right click on the label and click edit.

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

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by