How can I make sure a collective title spanning 8 subplots is written on a single line of text?

조회 수: 1 (최근 30일)
Hi All,
I created a figure consisting of 8 subplots, where each subplot has its own subtitle. There is also a collective title spanning all 8 figures. The problem I'm having is that this title is divided on 3 lines of text. I would like it to be on a single line of text. The code I use looks as follows:
for jj = 1:lenght(f_name)
fig_handle = figure('name',f_name{jj}); %f_name is a cell in which the names of all the selected files are located.
fig_title=strrep(strrep(f_name(jj),'_',' '),'.gd2','');
f_date = getfiledate([p_name,f_name{jj},'.gz']); %.gz has to be added because the script will not be able to load the filedate otherwise.
Comment = [fig_title,'Date: ',f_date];
sgtitle(Comment); %This is where the collective title is introduced.
Idif=zeros(size((xy0_name),1),1); %xy0_name is a variable
title_list = {'1A','1B','2A','2B','3A','3B','4A','4B'};
for ii = 1:size((xy0_name),1) %Another empty list definition for later use.
subplot(2,4,ii);
x_val0=xy0(:,1); %xy0 is a matrix of variables
x_val1=xy1(:,1); %xy1 is a matrix of variables
Imeasure = xy0(:,ii+1);
Ifit = xy1(:,ii+1);
plot(x_val0,Imeasure); hold on;
plot(x_val1,Ifit);
leg=strvcat(leg,xy0_name(ii,:));
leg=strvcat(leg,xy1_name(ii,:));
end
end
Would anyone know how to make sure the collective title, which is introduced under sgtitle, appears on a single line of text?

답변 (0개)

카테고리

Help CenterFile Exchange에서 Subplots에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by