필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

How do I set properties for different vectors in a plot?

조회 수: 2 (최근 30일)
Mtlb Usr
Mtlb Usr 2011년 2월 7일
마감: MATLAB Answer Bot 2021년 8월 20일
I want to set several properties of plot3. I have the handle, but I can't set different properties for the three vectors of the plot3.
For example:
handle=plot3(v1,v2,v3);
set(handle(1),'Color',[1 0 0]);
set(handle(2),'Color',[1 1 0]);
set(handle(3),'Color',[1 0 1]);
How can I resolve this?
  댓글 수: 3
Mtlb Usr
Mtlb Usr 2011년 2월 7일
Hi Jiro,
Yes of course.
I ask how I can resolve the issue of give one color per each vector of plot3 function.
regards
Brett Shoelson
Brett Shoelson 2011년 2월 7일
PLOT3 creates a 3-Dimensional plot of your xyz data. It doesn't create three separate vectors. Perhaps you want PLOT, called 3 times (and HOLD ON)?

답변 (2개)

Oleg Komarov
Oleg Komarov 2011년 2월 7일

Is this what you're trying to achieve?

% 3 column vectors concatenated 
In = cumsum(rand(10,3));
plot(In)

Oleg


Walter Roberson
Walter Roberson 2011년 2월 7일
plot3() will produce 3 handles if and only if one of v1, v2, or v3 is a N x 3 array with N at least 2. In such a situation, using set() the way you do should be fine.
In general, consider instead setting the axes ColorOrder property.

이 질문은 마감되었습니다.

제품

Community Treasure Hunt

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

Start Hunting!

Translated by