Setting gca LinestyleOrder but not color order
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Jacob Cram
el 19 de Mzo. de 2015
Respondida: Mike Garrity
el 19 de Mzo. de 2015
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 comentarios
Respuesta aceptada
Mike Garrity
el 19 de Mzo. de 2015
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 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Subplots en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!