Declaring plot arguments/options beforehand
1 次查看(过去 30 天)
显示 更早的评论
I would like to declare arguments of plot function once and beforehand, so than I can use them in a loop or for many plots, which would avoid clutter. I need something like optimset.
I want something like following
lineColor = {'k', 'r', 'b', 'm'};
linestyle = {'-'; '--'; ':'; '-.'};
options = {'color',lineColor{j}, 'LineStyle', linestyle{j}}
for j = 1:4
plot(X(:,j), Y(:,j), options)
end
0 个评论
采纳的回答
Bruno Luong
2018-10-6
lineColor = {'k', 'r', 'b', 'm'};
linestyle = {'-'; '--'; ':'; '-.'};
for j = 1:4
options = {'color',lineColor{j}, 'LineStyle', linestyle{j}};
plot(X(:,j), Y(:,j), options{:})
end
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Change Markers 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!