I would like axis off except xlabel, but this is not working, why?
조회 수: 29 (최근 30일)
이전 댓글 표시
This is not working for me: axis off; xlabel('something');
댓글 수: 0
답변 (2개)
Azzi Abdelmalek
2015년 7월 7일
set(gca,'xtick',[],'ytick',[],'title',[],'ylabel',[]),
댓글 수: 2
Azzi Abdelmalek
2015년 7월 7일
Try this
h=findobj(gcf,'type','axes')
for k=1:numel(h)
set(h(k),'xtick',[],'ytick',[],'title',[],'ylabel',[]),
end
Mike Garrity
2015년 7월 7일
The axis('off') command turns off the visibility of all of the decorations of the axes. You need to turn the one you want back on:
ax = gca
axis(ax,'off')
xlabel(ax,'something')
ax.XLabel.Visible = 'on'
댓글 수: 3
Mike Garrity
2015년 7월 7일
Sorry, the . notation was introduced in R2014b. It sounds like you're running an earlier version. Something like this should work in both versions:
ax = gca
axis(ax,'off')
xlabel(ax,'something')
set(get(ax,'XLabel'),'Visible','on')
I generally use the dot notation because it's so much easier to read.
참고 항목
카테고리
Help Center 및 File Exchange에서 Axis Labels에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!