Update scatter plot with different colors set by the user
이전 댓글 표시
Hello,
I have a Gui that is plotting a scatter data into an axes. I want to be able to update the scatter with different colors by a depth condition (minfm, maxfm). The code is as follows:
scatter=findobj(eixo.Children,'type','Scatter');
minfm=[1000;2500];
maxfm=[2000;4000];
color={'blue';'green'};
[l,~]=size(scatter.YData);
[lin,~]=size(color);
V=repmat({'black'},1,l);
for i=1:lin
for j=1:l
if Y(j)>minfm(i) && Y(j)<maxfm(i)
V{:,j}=color{i,1};
end
end
end
set(scatter,'MarkerFaceColor',V{:});
I get the following error:
Error using matlab.graphics.chart.primitive.Scatter/set
There is no green property on the Scatter class.
The vector is ok, but I always get this error and it only plots everything in green
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Scatter Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!