saved pdf cuts off 3d text
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Walter Roberson
el 28 de Sept. de 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.
Respuestas (1)
Walter Roberson
el 28 de Sept. de 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 comentario
Mike Garrity
el 29 de Sept. de 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.
Ver también
Categorías
Más información sobre Graphics Performance en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!