Question: The following code below is in Matlab; how would you add a legend to the plot in matlab? X=buyers(xxx); Y=buyers(xxx); X4=Retail_Loc(xx); Y4=Retail_Loc(xx); if nRetailChains>x; X5=Retail_Loc(Retail_Chain_ID(x),x);
The following code below is in Matlab; how would you add a legend to the plot in matlab?
X=buyers(xxx); Y=buyers(xxx); X4=Retail_Loc(xx); Y4=Retail_Loc(xx); if nRetailChains>x; X5=Retail_Loc(Retail_Chain_ID(x),x); Y5=Retail_Loc(Retail_Chain_ID(x),x); X6=Retail_Loc(Retail_Chain_ID(x,x); Y6=Retail_Loc(Retail_Chain_ID(x),x); end figure(2); scatter(X,Y,40,'blue'); axis([0 100 0 100]); hold on; X=sellers(x); %x-location of firm Y=sellers(x); %y-location of firm figure(2); scatter(X,Y,20,'filled'); if nRetailOnly>x figure(2); scatter(X4,Y4,5,'red'), axis([0 100 0 100]) if nRetailChains>x; figure(2); scatter(X5,Y5,5,'y'), axis([0 100 0 100]) figure(2); scatter(X6,Y6,5,'green'), axis([0 100 0 100]) end end hold off;
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
