in plotting,instead of 'ro' its needed to show numbers
10 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
In plotting,instead of 'ro' its needed to show numbers
for example:
plot([0:20],[0:20],'ro')
its needed shows numbers from 1 up 20 instead of 'ro'
and please also refer DOC of this, I can't find it
0 comentarios
Respuesta aceptada
Daniel Shub
el 22 de Sept. de 2011
The "o" in "ro" is not really a letter or a number. You best bet might be to use a loop and the text command ...
figure;
hold on;
axis([0, 20, 0, 20]);
for x = 0:20
h = text(x, x, num2str(x));
set(h, 'HorizontalAlignment', 'Center', 'VerticalAlignment', 'Middle');
end
5 comentarios
Daniel Shub
el 22 de Sept. de 2011
Sorry, I missed that bit. After your code, you should be able to do:
for ipeak = 1:length(peakinds)
h = text(peakinds(ipeak), peakmags(ipeak), num2str(ipeak));
set(h, 'HorizontalAlignment', 'Center', 'VerticalAlignment', 'Middle');
end
Más respuestas (0)
Ver también
Categorías
Más información sobre Numeric Types 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!