Reputation: 151
I want to put a title above the four subplots, how can I do that ? I keep finding info on "suplabel" or "suptitle" for Matlab, but nothing for Scilab. I tried "title" but i'm not sure of how to use it
Here is my code:
scf(1);
clf(1);
drawlater();
title('Spectre du signal non bruité');
subplot(2,2,1);
plot(f_n,zeros(1,N),'bk',f_n,real(X),'ro',[f_n;f_n],[zeros(1,N);real(X)],'b');
xtitle('Partie réelle','f','Re[X(f)]');
subplot(2,2,2);
plot(f_n,zeros(1,N),'bk',f_n,imag(X),'ro',[f_n;f_n],[zeros(1,N);imag(X)],'b');
xtitle('Partie imaginaire','f','Im[X(f)]');
subplot(2,2,3);
plot(f_n,zeros(1,N),'bk',f_n,abs(X),'ro',[f_n;f_n],[zeros(1,N);abs(X)],'b');
xtitle('Module','f','|X|');
subplot(2,2,4);
plot(f_n,zeros(1,N),'bk',f_n,atan(imag(X)./real(X)),'ro',[f_n;f_n],[zeros(1,N);atan(imag(X)./real(X))],'b');
xtitle('Argument','f','arg[X]');
drawnow();
Upvotes: 1
Views: 3636
Reputation: 2955
You could also insert an UIlabel:
x=1:10;
y1=x**2;
y2=x**3;
y3=x**4;
y4=x**5;
f=scf(1);
clf(1);
drawlater();
f.figure_name='Spectre du signal non bruité';
as = f.axes_size;
disp(as)
uicontrol(f, "style", "text", ...
"string", "Spectre du signal non bruité", ...
"position",[as(1)/4 as(2)-17, as(1)/2 20],.. // => @top midle of figure
"fontsize",15);
subplot(2,2,1);
plot(x,y1);
xtitle('Partie réelle','f','Re[X(f)]');
subplot(2,2,2);
plot(x,y2);
xtitle('Partie imaginaire','f','Im[X(f)]');
subplot(2,2,3);
plot(x,y3);
xtitle('Module','f','|X|');
subplot(2,2,4);
plot(x,y4);
xtitle('Argument','f','arg[X]');
drawnow();
Upvotes: 1