>>x = linspace(0,10)
>> y1 = sin(x)
>> y2 = sin(2*x)
>> y3 = sin(4*x)
>> y4 = sin(8*x)
>> figure
>> subplot(2,2,1)
>> plot(x,y1)
>> title('Subplot 1: sin(x)')
>> xlabel('x'),ylabel('y1')
>> subplot(2,2,2)
>> plot(x,y2)
>> title('Subplot 2: sin(2x)')
>>xlabel('x'),ylabel('y2')
>> subplot(2,2,3)
>> plot(x,y3)
>> title('Subplot 3: sin(4x)')
>>xlabel('x'),ylabel('y3')
>> subplot(2,2,4)
>> plot(x,y4)
>> title('Subplot 4: sin(8x)')
>>xlabel('x'),ylabel('y4')
加入uicontrol('parent',xxxxxxx,'style','text','string','XXXXXXXXX','pos',xxxxxxxxxxx)在subplot中间加个坐标轴,设置坐标轴的xcolor和ycolor属性为窗口的背景颜色;去掉xtick和ytick。
然后title输出你要添加的大标题。
呵呵,这个办法有点糊弄。:)
x=linspace(-2,2)subplot 221
plot(sin(x),'r')
subplot 222
plot(sin(2*x),'g')
subplot 223
plot(sin(3*x),'b')
subplot 224
plot(sin(4*x),'k')
a=axes('visible','off')
hold on
plot(0,0,'r')
plot(0,0,'g')
plot(0,0,'b')
plot(0,0,'k')
legend('sin x','sin 2x','sin 3x','sin 4x','location','north')
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)