You are on page 1of 8

SOLVED MATLAB GRAPHICS PROBLEMS

Gokul Krishna Kadam TKIET, Warananagar. Department of chemical engineering TYPES OF PLOTS

LINE PLOTS

BAR PLOTS

PIE CHARTS

HISTOGRAMS

POLAR PLOTS

1.plot 2.plotyy 3.semilogx 4.semilogy 5.loglog 6.area 7.errorbar 8.plot3

1.bar 2.barh 3.bar(stacked) 4.barh(stacked) 5.hist 6.pareto

1.pie 2.pie3

1.hist 2.rose

1.polar 2.rose 3.compass

c d e f

g h i

a=New figure b=open file c=save figure d=print figure e=edit plot f=zoom in g=zoom out

h=pan i=rotate 3D-for rotation of figure j=data cursor- indicates data of that perticular point k=colorbar- for changing the color of the figure l=legend-for addition of legend.

Question 1: x=[1 2 3 4 5 6 7 8] y=[1 2 3 4 5 6 7 8] plot(x,y) xlabel(x) ylabel(y) title(x vs y) Ans:

Question 2: x=[1 2 3 4 5] y=[2 5 8 12 14] z=[1 3 7 9 11] plotyy(x,y,y,z) xlabel(x) ylabel(y and z) title(x vs y and y vs z) Ans:

Question 3: X=[1 2 3 4 5 6 7 8 9 10] Y=[0 5 6 7 6 5 3 4 5 6] area(x,y) xlabel(x) ylabel(y) title(x vs y) Ans:

grid on

Question 4:

Y=[9 8 7 876 765 654 432 3 2 1] Bar(y) colormap summer grid on xlabel(x1,x2,x3) ylabel(y) title(x vs y) Ans:

Question 5: Y=[9 8 7 876 765 654 432 3 2 1] Bar3(y) colormap summer

grid on xlabel(x1,x2,x3) ylabel(y) zlabel(z) title(x,y,z) Ans:

Question 6: Y=[9 8 7 876 765 654 432 3 2 1] barh(y) grid on xlabel(y) ylabel(x1,x2,x3) title(x vs y) Ans:

Question 7: x=[60 180 120 180 30 120] pie3(x) colorbar Ans:

Question 8: t=o:pi/20:2*pi y=exp(sin(t))

plotyy(t,y,t,y,plot,stem) xlabel(x axis) ylabel(y axis) title(two y axis) grid on

Question 9: [x,y]=meshgrid(-8:.5:8) R=sqrt(x.^2+y.^2)+eps z=sin(R)./R mesh(x,y,z,Edgecolor,black) surf(x,y,z) colorbar

Question 10: x=0:pi/100:2*pi y=sin(x) plot(x,y) xlabel(x=0:2\pi) ylabel(sine of x) title(plot of the sine function,Fontsize,12) grid on

You might also like