Single value in colors vector causes error in scatter plot
이전 댓글 표시
Hi,
I have the following code that works perfectly, the NaN values in the colors vector are skipped as desired:
>> colors = [NaN, 121, NaN, 150]
colors =
NaN 121 NaN 150
>> scatter([1,2,3,4], [1,2,3,4], 50, colors, 'filled');
which produces the following graph:

However, when i replace a value in the colors array with NaN it all goes wrong:
>> colors = [NaN, 121, NaN, NaN]
colors =
NaN 121 NaN NaN
>> scatter([1,2,3,4], [1,2,3,4], 50, colors, 'filled');
Warning: Error updating Scatter.
The logical indices contain a true value outside of the
array bounds.
Which stops the scatter graph from being plotted, it seems to happen when the vector is all NaN but one value.
Why does simply changing one of the values to NaN cause this error?
It doesn't matter which value is changed, but as soon as there is a single value surrounded by NaN's it will break.
Thanks in advance for any suggestions
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Orange에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
