उपयोग gscatter
है, जो एक बिखराव साजिश करता है में मदद कर सकते हैं, (आपके मामले में Label
) एक समूह का उपयोग कर अलग अलग रंग/निर्माताओं में प्लॉट करने के लिए।
GSCATTER(X,Y,G,CLR,SYM,SIZ) specifies the colors, markers, and
size to use. CLR is either a string of color specifications or
a three-column matrix of color specifications. SYM is a string
of marker specifications. Type "help plot" for more information.
For example, if SYM='o+x', the first group will be plotted with a
circle, the second with plus, and the third with x. SIZ is a
marker size to use for all plots. By default, the marker is '.'.
'rgcmykwb'
की तरह तो आप निर्दिष्ट कर सकते रंगों पहले समूह के लिए लाल करने के लिए, दूसरा, आदि या []
के लिए हरे रंग की बस मैटलैब तरह इसे बाहर है।
डिफ़ॉल्ट रूप से मैटलैब प्रत्येक समूह के लिए एक ही मार्कर का उपयोग करता है, इसलिए आपको यह निर्दिष्ट करना होगा कि आप प्रत्येक समूह के लिए किस मार्कर का उपयोग करना चाहते हैं। यदि आप '.ox+*sdv^<>ph'
करते हैं तो आप मैटलैब के सभी मार्करों के साथ बस चक्र लेंगे।
n=50;
% make nx2 matrix of random points.
points = random('unif',0,1,n,2);
% make nx1 matrix of random labels from {1,2,...,5}
labels=round(random('unif',1,5,n,1));
% plot. Let Matlab sort out the colours and we will specify markers.
gscatter(points(:,1),points(:,2),labels,[],'ox+*sdv^<>ph.')
ऐसा लगता है कि इस तरह एक सा:
[matlab में सशर्त बिखराव] की
संभव डुप्लिकेट (http://stackoverflow.com/questions/8533136/conditional-scatter-in-matlab) – yuk