Scilab general title above subplots

73 Views Asked by At

I use Scilab 2023.1

is there a possiblity to add a title above all subplots?

I tried

Scilab general title on subplot window

Is there a better solution, please see attached picture.enter image description here

1

There are 1 best solutions below

0
Stéphane Mottelet On

There is no out-of-the box solution, but here is a proposal:

clf
for i=1:4
    subplot(2,2,i)
    plot(1:10,sin(i*(1:10)))
    title(sprintf("subplot %d",i))
end

// stretch children axes vertically
alpha=0.91;
for ax=gcf().children'
    ax.axes_bounds(2)=1+alpha*(ax.axes_bounds(2)-1)
    ax.axes_bounds(4)=ax.axes_bounds(4)*alpha
end
// create new axes above and create title text
h=newaxes();
h.axes_bounds=[0 0 1 1-alpha];
xstringb(0,0,"This is an overall title",1,0.1)
gce().font_size=3

enter image description here