I know this is a very common question, and I tried many answers given, setting Xtick to [], XTickLabel, YTick, YTickLabel etc...but still not working. Can someone please tell me how to remove the axes labels, cause they are interfering with the image I am diplaying on the axes. Would appreciate a hint !

답변 (1개)

Azzi Abdelmalek
Azzi Abdelmalek 2016년 4월 4일

4 개 추천

t=1:10
y=t.^2
plot(t,y)
set(gca,'xtick',[])

댓글 수: 9

I am not using plot. My code is like this:
axes(handles.axes1);
imshow(img);
And I tried putting the set(gca,'xtick',[]) statement between these two lines but still not working !
Azzi Abdelmalek
Azzi Abdelmalek 2016년 4월 4일
편집: Azzi Abdelmalek 2016년 4월 4일
set(handles.axes1,'xtick',[])
ImageProcessor
ImageProcessor 2016년 4월 4일
편집: ImageProcessor 2016년 4월 4일
No man, still not working. I even opened the 'Properties Inspector' box for the axis and manually set the 'xtick' property to []. But nothing. Is there some angle I am not seeing ? This is the output am getting:
Azzi Abdelmalek
Azzi Abdelmalek 2016년 4월 4일
It seems that those ticks are part of your image.
Azzi Abdelmalek
Azzi Abdelmalek 2016년 4월 4일
편집: Azzi Abdelmalek 2016년 4월 4일
you can get ride of those ticks by trying something like
img(:,1:10)=[] % you have to find the limits
img(end-10:end,:)=[]
imshow(img)
% im is your image
The ticks are being generated by something later, or on a different axes that happens to align with that one. Or the labels are on the y or z axes.
By the way, more robust would be
imshow(img, 'Parent', handles.axes1);
axis(handles.axes1, 'image');
set(handles.axes1, 'xtick', [], 'ytick', [], 'ztick', []);
ImageProcessor
ImageProcessor 2016년 4월 4일
Thank you Walter and Azzi ! Problem Solved.
Walter Roberson
Walter Roberson 2016년 4월 4일
What turned out to be the problem?
ImageProcessor
ImageProcessor 2016년 4월 5일
Was a minor syntax problem from my side. Plus some other changes.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Axis Labels에 대해 자세히 알아보기

질문:

2016년 4월 4일

댓글:

2016년 4월 5일

Community Treasure Hunt

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

Start Hunting!

Translated by