心形线:
x1=[-2 -1.9 -1.8 -1.7 -1.6 -1.5 -1.4 -1.3 -1.2 -1.1 -1 -0.9 -0.8 -0.7 -0.6 -0.5 -0.4 -0.3 -0.2 -0.1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2];
y1=[1.6 1.5 1.7 0.7 2 0.5 2.2 0.4 2.3 0.3 2.2 0.2 2 0.1 1.8 0 1.6 -0.2 1.4 -0.3 1.3 -0.4 1.4 -0.3 1.6 -0.2 1.8 0 2 0.2 2.2 0.3 2.3 0.4 2.2 0.5 2 0.7 1.7 1.5 1.6];
plot(x1, y1,'-r.','LineWidth',6)
title('LOVE','Color','r','FontSize',16);
set (gca,'position',[0.1,0.4,0.8,0.4])
折线图:
subplot(2,2,1);x=[1 2 3]; y=[1 2 3];y2=[1 4 8]; plot(x,y,'-r.');title('图一','position',[2 -1.1]);hold on;plot(x,y2,'-b.');xlabel('x轴');ylabel('y轴');set(gca,'ygrid','on');legend('1','2','location','north');text(2,2,'love','color','g');subplot(2,2,2);x=[1 2 3]; y=[1 2 3];y2=[1 4 8]; plot(x,y,'-r.');title('图二','position',[2 -1.1]);hold on;plot(x,y2,'-b.');xlabel('x轴');ylabel('y轴');set(gca,'ygrid','on');legend('3','4','location','northoutside');
柱状图:
figure;bar3h(1,1);hold on;bar3h(2,2);text(1,1.02,'1');text(2,2.02,'2');title('柱形图'); legend('一','二');grid on;set(gca,'xgrid','off');set(gca,'xtick',1:5:84);xlabel('日期');ylabel('钱(w)');set(gca, 'gridcolor', 'k');set(gca, 'gridlinestyle', '--');
set(gca, 'gridalpha', 0.3);set(gca,'xticklabel',{'50','100'});
制表:
data_row1=[68,68,86,43];
data_row2=[48,15,37,25];
data=[data_row1;repmat(data_row2,12,1)];
str1='气旋';str2='TC';
m=13;n=4;
column_name=strcat(str1,num2str((1:n)'));
row_name=strcat(str2,num2str((1:m)'));
set(figure(1),'position',[200 200 450 330]);
uitable(gcf,'Data',data,'Position',[120 120 400 290],'Columnname',column_name,'Rowname',row_name);
地图:
a = rand(50,50);
imagesc(a)
axis equal;
grid on
colormap([1 1 1;0 0 0]);



