Setting gca LinestyleOrder but not color order
조회 수: 2 (최근 30일)
이전 댓글 표시
I notice that when I try to set the axis line style order without setting the color order, the change doesn't seem to take. For instance the following example code, everything workes as expected if run as is, but if I comment out the set(gca,'ColorOrder',...) line the linestyleorder property seems to have no effect. Does anyone know why this is?
clf
set(gca, 'ColorOrder', [0 0 0; 0.5 0.5 0.5]);
set(gca, 'LineStyleOrder', {'-', ':', '--', '-.', '--', '*', '.'}); % different line styles
hold all
for i = 1:6
plot( rand( 1, 10 ) );
end
댓글 수: 0
채택된 답변
Mike Garrity
2015년 3월 19일
It doesn't move to the next entry in the LineStyleOrder until it's completed a lap of the ColorOrder. Since you are creating 6 plots and the default ColorOrder has 7 entries, you haven't reached the point where it changes the LineStyle. When you set the ColorOrder, you're setting it to an array which has fewer than 6 entries, so you do increment the LineStyle.
Does that make sense?
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Graphics Object Properties에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!