필터 지우기
필터 지우기

Axes' labels gone under perspective projection?

조회 수: 3 (최근 30일)
Dikun
Dikun 2013년 11월 15일
답변: Iman 2014년 5월 12일
Recently I've been using slice to visualize 3D grid. Everything is fine if the projection is orthographic. If I set(gca,'projection','perspective'), all the axis labels are gone. They can be restored when the projection is set back to orthographic. Anyone knows why and how to fix it?
I'm using 2012b. Thanks!!!

답변 (3개)

Walter Roberson
Walter Roberson 2013년 11월 15일
Random guess: try
opengl software
If that doesn't work we will need to know which operating system you are running on (including version)
  댓글 수: 1
Dikun
Dikun 2013년 11월 15일
Doesn't work... It happened on both Windows 7 and 8. My current workaround is to use text(x,y,z,string). But it's static if I rotate the object. Still want to use xlabel.

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


Mike
Mike 2013년 11월 22일
I'm running into the same issue with patch. I found that if the number of patches is small, and I do not use FaceAlpha, labels are displayed correctly. But, these limitations are frustrating.
figure(1)
clf
view(3);
camproj('perspective') % If commented out, labels are shown
axis vis3d
N = 1e3; % Labels disapear for high N
fv.Faces = [1:N-2;2:N-1;3:N]';
fv.Vertices = randn(N,3);
%patch(fv,'EdgeColor',repmat(0.6,1,3),'FaceColor',[0.6 0.6 0.8])
patch(fv,'EdgeColor',repmat(0.6,1,3),'FaceColor',[0.6 0.6 0.8]...
,'FaceAlpha',0.5) % Labels diasapear when alpha is used
xlabel('x')
ylabel('y')
zlabel('z')
  댓글 수: 2
Walter Roberson
Walter Roberson 2013년 11월 23일
Mike: Using FaceAlpha would force it to use the opengl renderer, which is the only one that supports transparency.
Have you experimented with "opengl software" that I mentioned above?
Mike
Mike 2013년 12월 18일
Sorry, I did not notice your response until now.
Yes, I have tried the opengl software command. But I noticed no difference.
I too am running Windows 7. MATLAB 2011a.

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


Iman
Iman 2014년 5월 12일
I've been having this problem as well. What I've found is 'painter' or 'zbuffer' keeps the titles and axes:
set(gcf,'Renderer','zbuffer')
or
set(gcf,'Renderer','painters')
(as opposed to set(gcf,'Renderer','OpenGL').
However other problems show up:
painter rendering does does seem to support RGB cdata (i have a patched object which disappears when i used painter rendering,
zbuffer rendering does not allow transparency.
This are things which I need to show so fixing the title and axes position has created these other problems.
But if you need the title and axes and don't need to worry about transparency or patch coloring, the other renderings would fix your problem.

카테고리

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