MATLAB Answers

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

20 views (last 30 days)
Kateri Kaminski
Kateri Kaminski on 5 Nov 2018
Answered: Sindar on 14 Jul 2019
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

Answers (1)

Sindar on 14 Jul 2019
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!