Dasar 2 Matlab Menambahkan Title Label dan Legend pada Grafik
x = linspace(-2*pi,2*pi,100);
y1 = sin(x);
y2 = cos(x);
y3=tan(x);
figure
plot(x,y1,x,y2)
title('Grafik dari Sin dan Cos antara -2\pi and 2\pi')
figure
plot(x,y1,x,y2)
title('Grafik dari Sin dan Cos antara -2\pi and 2\pi')
figure
plot(x,y1,x,y2,x,y3)
title('Grafik dari Sin dan Cos antara -2\pi and 2\pi')
legend('y = sin(x)','y = cos(x)','y = tan (x)')
xlabel('-2\pi x 2\pi') % x-axis label
ylabel('sine and cosine values') % y-axis label
figure
plot(x,y1,x,y2)
legend('y = sin(x)','y = cos(x)','Location','northeastoutside')
title('Grafik dari Sin dan Cos antara -2\pi and 2\pi loc northeastoutside')
legend('y = sin(x)','y = cos(x)','Location','southwest')
% 'north' Inside top of axes
% 'south' Inside bottom of axes
% 'east' Inside right of axes
% 'west' Inside left of axes
% 'northeast' Inside top-right of axes (default for 2-D axes)
% 'northwest' Inside top-left of axes
% 'southeast' Inside bottom-right of axes
% 'southwest' Inside bottom-left of axes
% 'northoutside' Above the axes
% 'southoutside' Below the axes
% 'eastoutside' To the right of the axes
% 'westoutside' To the left of the axes
% 'northeastoutside' Outside top-right corner of the axes (default for 3-D axes)
% 'northwestoutside' Outside top-left corner of the axes
% 'southeastoutside' Outside bottom-right corner of the axes
% 'southwestoutside' Outside bottom-left corner of the axes
% 'best' Inside axes where least conflict with data in plot
% 'bestoutside' To the right of the axes
% 'none' Determined by Position property
legend('y = sin(x)','y = cos(x)','Orientation','Horizontal')
legend('y = sin(x)','y = cos(x)','Orientation','Vertical')
Информация по комментариям в разработке