From: shahnaz fatima on
thanks for reply on scatter plot
i got nice plot using.
>> scatter(a(:,1), a(:,2), 'r')
>> hold on;
>> scatter(b(:,1), b(:,2), 'g')
>> scatter(c(:,1), c(:,2), 'b')

what can i do to get the points as small * , or filled dots insted of big circles.
From: Walter Roberson on
shahnaz fatima wrote:
> thanks for the reply.
> i tried to give these commands.
> but i am getting error.
> can you please solv emy problem.
>
> a=rand(10,2);
>>> b=rand(10,2);
>>> c=rand(10,2);
>>> scatter(a, 1, 'r');
> ??? Error using ==> scatter at 62
> X and Y must be vectors of the same length.

Sorry, the 1 is the dot size that has to appear before the color matrix.
I mentally jumped over the fact that it would be considered as the y
coordinate.
From: sscnekro on
> what can i do to get the points as small * , or filled dots insted of big circles.

Well, yeah, in that event .. I remember that I also hit on this problem at some point and instead used plot() that supports setting the marker size (controlling how big your * or circles etc .. are). This property is described in the link I sent you, so normally you would be able of seeing that. But as today I managed _not_to see_ something which obviously was there it is my duty to answer your question.

% black-edged circles, blank inside
plot(x,y, 'ko','LineWidth',1,'MarkerEdgeColor','k','MarkerSize',3);

% black-edged circles, red inside
plot(x,y, 'ko','LineWidth',1.5,'MarkerEdgeColor','k', 'MarkerFaceColor', 'r','MarkerSize',3);

Note that you control the thickness of edge of your symbols by line width, whereas the size of your symbols by marker size.

PS Please ML Expert, do correct me in the event scatter() supports this stuff as well or whatever typo, I'm too tired and no expert. Thanks.
From: sscnekro on
> scatter(a, 1, 'r');
> hold on

It's good to pay attention to what Walter writes. I just now discovered that
scatter(a(:,1),a(:,2),4,'r')
will indeed work. If you replace 4 by 1 as Walter wrote, you_will_create scatter dots, but they are almost invisible and all you would think you see is a blank set of axis.
From: us on
"shahnaz fatima" <shahnaz1981fat(a)gmail.com> wrote in message <hvtf1k$3aa$1(a)fred.mathworks.com>...
> hai all there
>
> i have one variable say 'a' which has 10 rows and 2 columns. i.e, there are 10 instances of 2 dimentional.
>
> similarly i have anothor two variables, 'b' and 'c'. all are having 10 instances, in two dimensions.
> or simply , a=rand(10,2); b=rand(10,2); c=rand(10,2).
>
> i want to plot these a, b and c on scatter plot diagram each with different symbols or colours.
>
> but i am not getting that. anybody can explain.
>
> can anybody help me on this.please
>
> waiting for the reply.

one of the many solutions

% the data
g1=rand(2,2);
g2=rand(3,2)+1;
g3=rand(5,2)+2;
cm=[[1,0,0];[0,1,0];[0,0,1]].'; % <- colors/grp
ms=[20;50;80]; % <- size/grp
% the engine
v=[g1;g2;g3];
gx=[1,size(g1,1),size(g2,1),size(g3,1)];
gx=cumsum(accumarray(cumsum(gx.'),1));
gx(end)=[];
% the result
scatter(v(:,1),v(:,2),ms(gx),cm(gx,:),'filled');

us