![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/186553/image.bmp)
How to use different marker styles rather than different marker colors?
24 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I have a plot with 10 different series. I want each to appear as a different marker style rather than different colors, but don't want to specify the marker style for each plot manually. Is there a way to choose different marker styles rather than different marker colors?
x=rand(10)
y =1:1:10
figure
for k=1:10
scatter(x(:,k),y,10), hold on%10 is marker size, ...
end
hold off
1 Kommentar
Ali
am 29 Okt. 2017
if true
--------------------------------------------------- code start
This is an example for your case
Input is "Input_Data", two dimension matrix
Marker_Counter=1;
figure6=figure;
Markers = {'+','o','*','x','v','d','^','s','>','<'};
for i=1:10:size(Input_Data,1)
TPR=Input_Data(i:i+9,7);
FPR=Input_Data(i:i+9,8);
plot(FPR,TPR,strcat('-',Markers{Marker_Counter}));
Marker_Counter=Marker_Counter+1;
hold on
end
plot([0.5 1],[0.5 1],'--');
legend('Minpts = 100','Minpts = 200','Minpts = 300','Minpts = 400','Minpts = 500','Minpts = 600','Minpts = 700','Minpts = 800','Minpts = 900','Minpts = 1000','','Location','SouthEast');
xlabel('FPR or (1-Specificity)','FontSize',12,'FontWeight','bold'); ylabel('TPR or Spensitivity)','FontSize',12,'FontWeight','bold');
title('ROC Space');
close(gcf);
-------------------------------------------- code end
end
--------------------------------------- picture link preview
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/186553/image.bmp)
Akzeptierte Antwort
KSSV
am 16 Mai 2017
x=rand(10) ;
y =1:1:10 ;
m = {'o' , '+','*','.','x','s','d','^','v','>','<','p','h'} ;
figure
for k=1:10
scatter(x(:,k),y,20,m{k})
hold on %10 is marker size, ...
end
hold off
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Scatter Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!