필터 지우기
필터 지우기

I would like axis off except xlabel, but this is not working, why?

조회 수: 29 (최근 30일)
Mr M.
Mr M. 2015년 7월 7일
댓글: Azzi Abdelmalek 2015년 7월 7일
This is not working for me: axis off; xlabel('something');

답변 (2개)

Azzi Abdelmalek
Azzi Abdelmalek 2015년 7월 7일
set(gca,'xtick',[],'ytick',[],'title',[],'ylabel',[]),
  댓글 수: 2
Mr M.
Mr M. 2015년 7월 7일
This is not working for me: "invalid object handle" Maybe, the problem is that I am in a subfigure. ?
Azzi Abdelmalek
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
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
Mr M.
Mr M. 2015년 7월 7일
편집: Mr M. 2015년 7월 7일
It is not possible, what you have written. The error message is: "Warning: Struct field assignment overwrites a value with class "double". See MATLAB R14SP2 Release Notes, Assigning Nonstructure Variables As Structures Displays Warning, for details. > In myprog at 68
ax =
XLabel: [1x1 struct]"
Mike Garrity
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 CenterFile Exchange에서 Axis Labels에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by