Removing Upper XTicks ..or Right Y Ticks..How?

조회 수: 112 (최근 30일)
Orkun OZENER
Orkun OZENER 2011년 6월 16일
댓글: Chaoyue Zhang 2022년 5월 17일
Hi,
I am trying to remove the Xticks that is located only at the upper side and the YTicks that is located right side of my plot.But I could not managed to do it.
I Tried
set(gca, 'XTick',[])
...
set(gca, 'YTick',[])
command but they removed both X ticks up and above or or Both Y Ticks left and right.
Is there any way of removing only one side (up or above...left or right.)
Thanks From Now... Orkun ÖZENER
  댓글 수: 1
Arturo Moncada-Torres
Arturo Moncada-Torres 2011년 6월 16일
Could you please also post the code where you are plotting? Maybe even some sample data?

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

답변 (2개)

Bjorn Gustavsson
Bjorn Gustavsson 2011년 6월 16일
set(gca,'box','off')
  댓글 수: 2
Orkun OZENER
Orkun OZENER 2011년 6월 16일
Thanks Bjorn,
This is an alternative solution what I want...Really thanks...
I missed out this alternative..
It solved my problem temporarily...
But how can I do it with the box is located...
The box is located..And the tick marks at the up are removed..?
How...I am searching...
Bjorn Gustavsson
Bjorn Gustavsson 2011년 6월 16일
I don't know if you can. Maybe the simplest is just to plot the box manually?
isholdonque = ishold;
hold on
ax = axis;
plot(ax(2)*[1,1],ax(3:4),'k','linewidth',0.5)
plot(ax(1:2),ax(4)*[1,1],'k','linewidth',0.5)
if isholdonque == 0
hold off
end

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


Arturo Moncada-Torres
Arturo Moncada-Torres 2011년 6월 16일
I recommend you to look at this thread, where your same question has already been answered in several ways ;-).
  댓글 수: 5
Leon Aksman
Leon Aksman 2018년 12월 19일
Works, thanks a lot!
Chaoyue Zhang
Chaoyue Zhang 2022년 5월 17일
It does work! Thank you!

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

카테고리

Help CenterFile Exchange에서 Specifying Target for Graphics Output에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by