Clear Filters
Clear Filters

How do I label Lines

86 views (last 30 days)
Kim Nguyen
Kim Nguyen on 12 Apr 2013
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 Comment
Kim Nguyen
Kim Nguyen on 12 Apr 2013
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

Sign in to comment.

Accepted Answer

Mahdi
Mahdi on 12 Apr 2013
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 Comments
Kim Nguyen
Kim Nguyen on 12 Apr 2013
How do i edit the label inside the figure? I tried but it nothing is happening
Mahdi
Mahdi on 12 Apr 2013
Using the Edit Plot tool (pointer thing that looks like a mouse), right click on the label and click edit.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!