How do I label Lines

64 次查看(过去 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 中查找有关 Axis Labels 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by