How to define LineSpec in one variable?
40 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Stephan
el 7 de Dic. de 2020
Comentada: Stephan
el 7 de Dic. de 2020
Hello everyone,
I would like to specify the line properties in one variable. For example, the code
plot([1,2],[1,2],'Color','black','LineWidth',2);
should be replaced by a code of the form (which produces an error):
LineSpec = {'Color','black','LineWidth',2};
plot([1,2],[1,2],LineSpec);
Thanks for any help!
plot([1,2],[1,2],'Color','black','LineWidth',2);
0 comentarios
Respuesta aceptada
Walter Roberson
el 7 de Dic. de 2020
LineSpec = {'Color','black','LineWidth',2};
plot([1,2],[1,2],LineSpec{:});
Más respuestas (0)
Ver también
Categorías
Más información sobre Line Plots en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!