How do I label Lines

78 visualizaciones (últimos 30 días)
Kim Nguyen el 12 de Abr. de 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 comentarioMostrar -1 comentarios más antiguosOcultar -1 comentarios más antiguos
Kim Nguyen el 12 de Abr. de 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

Iniciar sesión para comentar.

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

Iniciar sesión para comentar.

Categorías

Más información sobre Axis Labels en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by