Setting gca LinestyleOrder but not color order
3 次查看(过去 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 中查找有关 Subplots 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!