Show tick marks above plot

조회 수: 121 (최근 30일)
Bernoulli Lizard
Bernoulli Lizard 2013년 2월 4일
댓글: Maciej Dabrowski 2020년 12월 1일
I have a 3D plot that I am viewing from the top, so that it looks like a 2D plot. How can I display the tick marks above the plot? I tried using
set(gca, 'Layer', 'top')
but that only brought the major tick marks to the top and left the minor tick marks hidden. Worse, it also brought the dotted gridlines, which I do not want to see, to the top.
  댓글 수: 1
itamar luzon
itamar luzon 2018년 12월 25일
I know it's been a long time, but
use this after ploting
set(gca,'Layer','top')

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

답변 (3개)

junlong
junlong 2016년 3월 17일
편집: junlong 2016년 3월 17일
I was looking for the same thing, and I think you almost got the answer. Just turn the grid off.
set(gca, 'Layer', 'top');
grid off

Azzi Abdelmalek
Azzi Abdelmalek 2013년 2월 4일
편집: Azzi Abdelmalek 2013년 2월 4일
Use
a=xlim;
set(gca,'xlabel',linspace(a(1),a(2),8))
%do the same for ylabel and zlabel
  댓글 수: 3
Azzi Abdelmalek
Azzi Abdelmalek 2013년 2월 4일
You must insert the above code after your plot
Maciej Dabrowski
Maciej Dabrowski 2020년 12월 1일
I didn't work for me as well. I'm getting Error using matlab.graphics.axis.Axes/set
Error setting property 'XLabel' of class 'Axes':
Value must be a handle.

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


Sean de Wolski
Sean de Wolski 2013년 2월 4일
hAx = axes;
plot(1:10);
set(hAx,'XAxisLocation','Top');
  댓글 수: 3
Bernoulli Lizard
Bernoulli Lizard 2013년 2월 4일
Is there a way to move it to the top of the z-axis instead?
Sean de Wolski
Sean de Wolski 2013년 2월 4일
Hi Bernoulli,
I guess I don't see why this wouldn't work:
hAx = axes;
surf(hAx,peaks)
set(hAx,'XAxisLocation','Top');
view(2)
xlabel('Hello World')
Please post a picture of what you expect, and where.

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

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by