如何防止 axis off 删除字幕?

How to prevent axis off from removing the subtitle?

如何防止axis off删除字幕? Nemely,我只想删除 x,y 轴而不是字幕本身。

img = imread('cameraman.tif');
figure;
imagesc(img);
title('A');
subtitle('B');

如果我在末尾添加 axis off 它会给我:(副标题 B 不见了...)

您可以执行以下操作:

img = imread('cameraman.tif');
figure;
imagesc(img);
title('A');
subtitle('B');
set(gca,'xtick',[]);
set(gca,'xticklabel',[]);
set(gca,'ytick',[]);
set(gca,'yticklabel',[]);