How to have number as marker symbol in plot
Mostra commenti meno recenti
I'm trying to have a plot with number form 1 to 150 as a marker symbol.I have this but it doesn't work.please help
if true
% code
mark=zeros(1,class_length);
for i=1:class_length
mark(:,i)=i;
ma=num2str(mark);
malength=length(ma);
end
if mode==6 && colorflag==0
box on;
hold on;
for i=1:class_length
for p=1:malength
if classlabel(i)==p
plot(x(i),y(i),'Marker',mo(p),'MarkerSize',fontsize,'Color',colors(7));
end
end
end
hold off;
end
Risposta accettata
Più risposte (1)
Mischa Kim
il 9 Feb 2014
Modificato: Mischa Kim
il 9 Feb 2014
x = 0:1:10;
y = sin(x);
plot(x,y,'-r')
hold on
for ii = 1:length(x)
text(x(ii),y(ii),num2str(ii),'Color','r')
end
3 Commenti
shirin
il 9 Feb 2014
Jason Adkins
il 21 Mag 2020
Ah so easy, thank you!
VIGNESH BALAJI
il 13 Lug 2023
This idea of plotting text in plot is very useful to number data and sorting them out. Thanks :)
Categorie
Scopri di più su Surface and Mesh Plots in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!