필터 지우기
필터 지우기

Children of scatterplot

조회 수: 5 (최근 30일)
Naum Derzhi
Naum Derzhi 2012년 6월 5일
Hello everyone, its me again trying to use the scatter plot
It looks like if the number of points exceeds 100, you cannot get access to scatterplot children.
Here is the piece of code:
[EDIT (formatted code) -- the cyclist]
%------------------------------------------------
nP=100;
x=rand(nP,1);
y=rand(nP,1);
h=scatter(x,y,64,1:nP);
points=get(h,'Children');
numel(points)
%----------------------------------------------
If nP<=100 the code above gives the correct number of children. Otherwise it gives only ONE child, which has no children of its own.
Is this another undocumented feature? Or am I doing something wrong?
Thanks,
Naum Derzhi

채택된 답변

the cyclist
the cyclist 2012년 6월 5일
Yes to your first question. No to your second question. :-)
I think the 'v6' workaround mentioned in the article is already deprecated. However, the workaround mentioned in the comments, by Sebastiaan, should still work (although it is a bit inelegant).
  댓글 수: 1
Naum Derzhi
Naum Derzhi 2012년 6월 6일
Thank you. The workaround proposed by Sebastian is quite good, and it works. As for elegance ... Well, what can you do? Actually, I would not call it inelegant, it's fine IMHO. As long as Mathworks does not decrease the number in the future for another (or the same) misterious reason.
Thanks again.
Naum

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Graphics Performance에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by