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)
I have attached a portion of my code if that helps. Thanks!
%Create Plots
for j = index
fignum = fignum + 1;
hold on
for i = 1:numfiles
y = Farray(2:end);
yt = transpose(y);
x(:,:,i,j) = NewAmp(:,:,i,j);
xt(:,:,i,j) = transpose(x(:,:,i,j));
axis([0 Fmax 0 1.5*maxNewAmp(:,:,i,j)])
t1 = strcat("Reference Probe: ",fn(j));
t2 = strcat(namexparm, " = ", string(xparmmax(:,:,j)),"(", unitsxparm, ")");
suplabel('Amplitude', 'y')
hold off


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