How to set a new default linewidth for stem plots
8 次查看(过去 30 天)
显示 更早的评论
Hey,
I want to set a new default LineWidth for my stem-plots, so every new stem plot will be plotted with a LineWidth of '2'.
set(0,'defaultLineLinewidth',2)
The code line above only changes the LineWidth of continuous plots.
Thank you!
4 个评论
Mathieu NOE
2021-9-7
hello
% dummy data
x=0:4;
y=2*n;
% MyStem parameters
par.LineStyle = '--'; % Use one of these values: '-' |'--' | ':' | '-.' | 'none'.
par.LineWidth = 2;
par.Marker = '*';
par.MarkerSize = 8;
par.MarkerFaceColor = 'none';
hs = MyStem(x,y,par);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function hs = MyStem(x,y,par)
hs = stem(x,y, 'LineStyle',par.LineStyle, 'LineWidth',par.LineWidth, 'Marker',par.Marker, 'MarkerSize',par.MarkerSize, 'MarkerFaceColor',par.MarkerFaceColor)
end
回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!