saved pdf cuts off 3d text

1 次查看(过去 30 天)
Andrew
Andrew 2015-9-28
Hello everyone,
I have run into an odd problem with exporting a figure to a pdf file using the painters buffer. I am working with a surface object that I have created using the underlying surface syntax so that I can have the proper number of cells (unlike surf which reduces the number of cells by 1 in the row and column direction).
my call to surface is something like this
surface('xdata',x,'ydata',y,'zdata',z,'cdata',I,'edgecolor','none','facecolor','texturemap')
This does exactly what I want. Later I add some text to this figure
text(x1,y1,z1,'blah blah blah','interpreter','latex','fontsize',16,'backgroundcolor',[0.5,0.5,0.5],'color','r')
Everything looks great in my figure window and I'm happy with the result. Then I try to save the figure to a pdf file using the painters render to get vector graphics. I get this:
As you can see, for some reason part of the text is being cut off. What it should look like is this:
Has anyone else experienced a similar issue? Does anyone know how I can fix this? I've tried using uistack to make sure that the tex is the top layer but that hasn't changed anything. If I switch the renderer to opengl then things look alright, as you can see in the png, but I don't get the nice vector graphics that I'm looking for.
  2 个评论
Walter Roberson
Walter Roberson 2015-9-28
Which MATLAB version are you using? I suspect you are using R2014b or later, but it makes a significant difference if you are using an earlier version.
Andrew
Andrew 2015-9-28
Yes, I am using 2015a... If the problem doesn't exist in earlier versions I can likely get access to one of those.

请先登录,再进行评论。

回答(1 个)

Walter Roberson
Walter Roberson 2015-9-28
It is a coplanar limitation. You can change the coordinates of the text to make them slightly "closer" to the viewer than the item you are laying the text upon so that they are no longer coplanar.
  1 个评论
Mike Garrity
Mike Garrity 2015-9-29
Yes, or it could be a bug in the depth sort that the painters renderer uses. I would suggest sending some repro steps to Mathworks support so we can check it out.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Graphics Performance 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by