Lab Practice
Lab Practice
img = imread('bird.jpg');
subplot(3,3,1); % Use a 3x3 grid
imshow(img);
title('Bird Image');
axis on;
% Scatter plot
subplot(3,3,2);
scatter(x, sin(x));
xlabel('X values');
ylabel('sin(X)');
title('Scatter Plot');
z = x;
subplot(3,3,3);
plot3(x, y(1:length(x)), z, 'r');
grid on;
xlabel('X');
ylabel('Y');
zlabel('Z');
title('3D Line Plot');
% Surface plot
subplot(3,3,4);
surf(X, Y, Z);
shading interp;
xlabel('X');
ylabel('Y');
zlabel('Z');
title('Surface Plot');
% Contour plot
subplot(3,3,5);
contour(X, Y, Z);
xlabel('X');
ylabel('Y');
title('Contour Plot');
% Mesh plot
subplot(3,3,6);
mesh(X, Y, Z);
xlabel('X');
ylabel('Y');
zlabel('Z');
title('Mesh Plot');
subplot(3,3,7);
contourf(X, Y, Z, 20);
colorbar;
xlabel('X');
ylabel('Y');
title('Filled Contour Plot');
% Waterfall plot
subplot(3,3,8);
waterfall(X, Y, Z);
xlabel('X');
ylabel('Y');
zlabel('Z');
title('Waterfall Plot');