How do I present two overlapping surfaces using two transparent colors in one graph?

6 visualizaciones (últimos 30 días)
I'm currently trying to get a vector graphic image where two planes are prenseted in one 3D plot.
When I run my code on matlab, it shows a good preview. But then I can't get the same quality when importing that image into adobe illustrator.
I need to use illustrator to put multiple graphs together in one image with eps format.
This is what i want and what i get in the matlab live-editor preview.
And this is what I get when I copy the image as "vector graphics" and paste it on adobe illustrator.
As you can see, the the blue plane is almost completely hidden.
Are there any solutions for this? If there are alternative ways other than using illustrator, that will also be welcomed.
Thanks for reading it through.
(I attached my terrible code for your reference)

Respuestas (1)

Divyam
Divyam el 13 de Jun. de 2025
The issues you are facing are mainly due to the limitations in how MATLAB exports 3D plots to vector formats. This happens when you export figures as EPS or other vector formats where the 3D plots are flattened into 2D plots. This is partly due to EPS being an outdated export format for modern 3D graphics.
There are some alternative approaches that you can take to resolve your issue:
  • If the vector quality is not mandatory, export the plot as a high-res PNG. You can then import the PNG file to the Illustrator and combine the plots there. You can also save the plot to a PDF format for better graphics.
print(gcf, 'myplot.png', '-dpng', '-r600');
print(gcf, 'myplot.pdf', '-dpdf');
  • Use "exportgraphics"
exportgraphics(gcf, 'myplot.pdf', 'ContentType','vector');
  • Flatten the plots manually and overlay the planes by plotting one plane first and then plotting the second after using "hold on". This would make the rendering appear more layered on Adobe Illustrator.
surf(x1, y1, z1, 'FaceColor', 'red', 'EdgeColor', 'none'); hold on;
surf(x2, y2, z2, 'FaceColor', 'blue', 'EdgeColor', 'none');
For more information regarding "exportgraphics" refer to the following documentation:

Etiquetas

Productos


Versión

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by