MATLAB Answers

Trouble using suplabel() to create global axes for figure with multiple subplots

조회 수: 4(최근 30일)
Kateri Kaminski
Kateri Kaminski 2018년 11월 5일
답변: Sindar 2019년 7월 14일
Hello, I am having some trouble using suplabel(). I want 2 global axes labels (one x and one y) for my figure that contains multiple subplots. I was able to do this with the title using suptitle() so I am assuming I have a version of Matlab that can handle suplabel() as well but I am not getting it to work. Does anyone know why this might not be working? I get the following error message:
>> PostProcessing_filetest
Undefined function or variable 'suplabel'.
Error in PostProcessing_filetest (line 266)
suplabel('Frequecy(Hz)','x')
I have attached a portion of my code if that helps. Thanks!
%Create Plots
for j = index
figure(fignum)
fignum = fignum + 1;
hold on
for i = 1:numfiles
subplot(numfiles,1,i)
y = Farray(2:end);
yt = transpose(y);
x(:,:,i,j) = NewAmp(:,:,i,j);
xt(:,:,i,j) = transpose(x(:,:,i,j));
plot(y,xt(:,:,i,j))
title(fn(i))
axis([0 Fmax 0 1.5*maxNewAmp(:,:,i,j)])
end
t1 = strcat("Reference Probe: ",fn(j));
t2 = strcat(namexparm, " = ", string(xparmmax(:,:,j)),"(", unitsxparm, ")");
suptitle({char(t1);char(t2)})
suplabel('Frequecy(Hz)','x')
suplabel('Amplitude', 'y')
hold off
end

답변(1개)

Sindar
Sindar 2019년 7월 14일
sublabel does not exist in Matlab releases. You can download the user-created sublabel from the File Exchange and put it on your matlab path

Community Treasure Hunt

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

Start Hunting!

Translated by