如何在MATLAB中删除轴 [英] How to remove axis in MATLAB
本文介绍了如何在MATLAB中删除轴的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
axis off
无法正常工作.
function displayResults(filename,hObject, eventdata, handles)
% Open 'filename' file... for reading...
fid = fopen(filename);
for N=6:1:10
imagename = fgetl(fid);
if ~ischar(imagename), break, end % Meaning: End of File...
[x,map]=imread(imagename);
rgb=ind2rgb(x,map);
ax = handles.(sprintf('axes%d', N));
axis off;
image(rgb, 'Parent', ax);
end
guidata(hObject,handles)
上面的代码将导致以下输出:
Above code results in following output:
我在上图中突出显示了轴. 我使用的所有图像都是位深度为8的位图.我不需要这些轴,如何删除呢?
I've highlighted axis in above figure. All images I've used is bitmap with bit depth of 8. I don't want those axis, how can I remove that?
推荐答案
在每个循环的末尾插入以下内容:
insert the following at the end of each loop:
set(ax, 'Visible','off')
或者您可以对图中的所有轴执行一次操作:
or you can do this once for all axes in the figure:
set(findobj(gcf, 'type','axes'), 'Visible','off')
这篇关于如何在MATLAB中删除轴的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文