Matlab绘制黑色边框

hol*_*ola 2 matlab plot border

我在循环中有三个不同的图:两个图有边框,但有一个没有:

结果

我希望他们所有人都有黑色边框.我试图通过使用它,box但问题仍然存在.

hold on
figure(1),plot((delta1),Sref1,'*','Color',colors(i,:));title('Frequency [500MHz-1GHz]')
gcf=figure(1);
set(gcf,'Position', [0 0 290 245]);
hold off

hold on 
figure(2),plot((delta2),Sref2,'*','Color',colors(i,:));title('Frequency [1GHz-1.5GHz]')
gcf=figure(2);
set(gcf,'Position', [0 0 290 245]);
hold off 

hold on
figure(3),plot((delta3),Sref3,'*','Color',colors(i,:));title('Frequency [1.5GHz-2GHz]')
gcf=figure(3);
set(gcf,'Position', [0 0 290 245]);

hold off
Run Code Online (Sandbox Code Playgroud)

小智 5

只需box on在第一hold off行之前添加.

这段代码对我有用(Matlab 2012b):

hold on
figure(1),plot(1:10);title('Frequency [500MHz-1GHz]')
gcf=figure(1);
set(gcf,'Position', [0 0 290 245]);
box on
hold off

hold on 
figure(2),plot(1:10);title('Frequency [1GHz-1.5GHz]')
gcf=figure(2);
set(gcf,'Position', [0 0 290 245]);
hold off 

hold on
figure(3),plot(1:10);title('Frequency [1.5GHz-2GHz]')
gcf=figure(3);
set(gcf,'Position', [0 0 290 245]);

hold off
Run Code Online (Sandbox Code Playgroud)