[TOC]

stem

Stem plot

Usage

stem(y)

stem(y,spec)

stem(y,name1,value1,...,nameM,valueM)

stem(y,spec,name1,value1,...,nameM,valueM)

stem(x,y)

stem(x,y,spec)

stem(x,y,name1,value1,...,nameM,valueM)

stem(x,y,spec,name1,value1,...,nameM,valueM)

Examples

Input
x = linspace(-2*pi,2*pi);
stem(x,sin(x))
Output

stem_ex1

Input
np = 20;
nl = 3;
y = rand(np,nl);
x = 1:np;
stem(x,y)
legend('show')
legend('Stem 1','Stem 2','Stem 3')
xlim([0.3 20.3])
ylim([-0.02 1.02])
Output

stem_ex2

Input
y = rand(20,1);
x = 1:20;
stem(x,y,'--rs','filled')
xlim([0.3 20.3])
ylim([-0.02 1.02])
Output

stem_ex3

Input
y = rand(20,1);
x = 1:20;
stem(x,y,'--rs','markersize',4,'markerfacecolor',[.4 .6 .7],'linewidth',3)
xlim([0.3 20.3])
ylim([-0.02 1.02])
Output

stem_ex4