Scatter plot with different marker types

30 views (last 30 days)
Pavlov
Pavlov on 30 Sep 2014
Commented: Ali on 29 Oct 2017
I am looping through a bunch of data and want to use different marker styles (e.g. dots vs. crosses, etc.) for different categories of data. For example, for category A, I use this code:
scatter(ZpercCat(sesh),norm_amp(sesh),'MarkerEdgeColor',rgb, ...
'MarkerFaceColor',rgb)
to plot normal circles, and then I want to use crosses for category B using this code:
scatter(ZpercCat(sesh),norm_amp(sesh),'MarkerEdgeColor',rgb, ...
'MarkerFaceColor',rgb,'markertype','x')
but get the following error:
Error using specgraph.scattergroup/set
The name 'markertype' is not an accessible property for an instance of class
'scattergroup'.
Error in specgraph.scattergroup (line 26)
set(h,args{:});
Error in scatter (line 83)
h = specgraph.scattergroup('parent',parax,'cdata',c,...
  1 Comment
Ali
Ali on 29 Oct 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

Sign in to comment.

Accepted Answer

dpb
dpb on 30 Sep 2014
The scattergroup property name is marker
See
doc scatter
for the details...

More Answers (0)

Categories

Find more on RF Blockset Models for Transceivers in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!