Vous êtes sur la page 1sur 5

2D Plots:

Polar plot area(x,f)


>> x=-pi/2:pi/40:pi/2;
>> f=sin(4.*x);
>> Polar(x,f,'r--')

bar(x,f)

bar(f)
>> >> bar(temp,'stacked')
temp=[31,28,24;29,26,22;28,25,20;27,24,16 >> xlabel('months from sept to feb')
;26,22,17;29,25,20]; >> ylabel('temperature in celcius')
>> bar(temp,'group') >> legend('city A','city B','city C')
>> xlabel('months from sept to feb')
>> ylabel('temperature in celcius')
>> legend('city A','city B','city C')

>> x=[0 1 2 3 4 5 6]; Histogram


>> y=[10 15 25 30 35 40 45]; >> x=randn(100,1)*pi;
>> barh(x,y,'g') >> subplot(2,2,1)
>> hist(x)
>> subplot(2,2,2)
>> hist(x,15)
>> p=-2:0.1:2;
>> subplot(2,2,3)
>> hist(x,p)

Rose chart Pie Chart


>> x=randn(100,1)*pi; >> industry=[4 8 20 2 7 10];
>> subplot(2,2,1) >> show=[0 1 0 0 1 0];
>> rose(x) >>
>> subplot(2,2,2) label=({'cement','textile','software','che
>> rose(x,15) mical','telecom','banking'})
>> subplot(2,2,3)
>> p=-2:0.1:2; label =
>> rose(x,p)
'cement' 'textile' 'software'
'chemical' 'telecom' 'banking'

>> pie(industry,show,label);

>> x=-2:0.1:2;
>> y=x.*x;
Complex num plot
>> subplot(1,2,1) >> z=[1+1i 4-8i 20+7i 6+8i 9+2i
>> stairs(x,y,'r--')
>> subplot(1,2,2) 12-4i];
>> stem(x,y,'r--') >> compass(z)
3D Plotting
Plot3
>> t=-4:0.1:4;
>> x=t.^2;
>> y=4*t;
>> plot3(x,y,t,'r--')
>> xlabel('xaxis')
>> ylabel('yaxis')
>> zlabel('zaxis')

Bar3
>> t=-4:0.1:4;
>> x=t.^2;
>> y=4*t;
>> bar3(x,y)
>> bar3(x,y,t)

Bar3h
>> x;
>> y;
>> bar3h(x,y)
Pie3
>>
person=({'Manager','engineer','professor','doctor','architect','desighner'})

person =

'Manager' 'engineer' 'professor' 'doctor' 'architect' 'desighner'

>>
>> strength=[12 15 13 11 6 10];
>> explode=[0 0 1 0 0 1];
>> pie3(strength,explode,person)

Stem3
>> x=linspace(0,6*pi,200);
>> y=x.*cos(x);
>> z=x.*sin(x);
>> stem3(x,y,z)
>> figure(2)
>> stem3(x,y,z,'filled')

Mesh/meshgrid/surf/contour
/contour3
>> [x y]=meshgrid(-1:0.1:2,-2:0.1:2);
>>z=x.^2+y.^2
>> subplot(2,2,1)
>> mesh(x,y,z)
>> subplot(2,2,2)
>> surf(x,y,z)
>> subplot(2,2,3)
>> contour(x,y,z)
>> subplot(2,2,4)
>> contour3(x,y,z)

Vous aimerez peut-être aussi