saved pdf cuts off 3d text

2 views (last 30 days)
Andrew
Andrew on 28 Sep 2015
Commented: Mike Garrity on 29 Sep 2015
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 Comments
Walter Roberson
Walter Roberson on 28 Sep 2015
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 on 28 Sep 2015
Yes, I am using 2015a... If the problem doesn't exist in earlier versions I can likely get access to one of those.

Sign in to comment.

Answers (1)

Walter Roberson
Walter Roberson on 28 Sep 2015
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 Comment
Mike Garrity
Mike Garrity on 29 Sep 2015
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.

Sign in to comment.

Categories

Find more on Graphics Performance in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!