MATLAB: Change the lines’ widths in a stem plot, without changing the markers edges widths

linewidthmarkeredgestemstem plot

Hi, how can I change the lines' widths in a stem plot, without changing the markers edges' widths?
(I just want to modifiy the lines's widths and not the markers edges' thickness, either)
Example:
x = 1:10;
y = [2 5 4 1 2 4 1 8 1 2];
stem(x,y,'LineWidth',0.1,'MarkerSize',15,'MarkerFaceColor','g')
and I get this:
Instead if I change the LineWidth property as:
stem(x,y,'LineWidth',3,'MarkerSize',15,'MarkerFaceColor','g')
I get this:

Best Answer

You will need to use a combination of stem and scatter to get such a result. Check the following code
x = 1:10;
y = rand(1,10);
subplot(3,1,1)
stem(x,y,'LineWidth',2,'MarkerSize',15,'MarkerFaceColor','g')
subplot(3,1,2)
stem(x,y,'LineWidth',2,'MarkerSize',15,'MarkerFaceColor','g', 'MarkerEdgeColor', 'none')
subplot(3,1,3)
hold on
stem(x, y, 'LineWidth', 2, 'Marker', 'none')
scatter(x, y, 'filled', 'MarkerEdgeColor', 'b', 'MarkerFaceColor', 'g', 'SizeData', 200, 'LineWidth', 0.5)