Unable to copy plot3 image as vector

11 次查看(过去 30 天)
Hi there,
I'd like to use an image for editing in Illustrator, and it works perfectly when the image is in 2D format. I utilize the metafile option for the clipboard, and it functions seamlessly for 2D images. However, when attempting to use the same approach with a 3D plot generated using the plot3() command, it doesn't seem to work as expected. Could you please provide some guidance or assistance to resolve this issue? Thank you!
  1 个评论
Cedric Kotitschke
Cedric Kotitschke 2023-11-16
移动:Dyuman Joshi 2023-11-16
What exactly does not work?
This works for me
phi = 0:0.01:5*pi;
x = cos(phi);
y = sin(phi);
z = linspace(1,10,numel(phi));
plot3(x,y,z)
exportgraphics(gcf, 'myplot.pdf', 'ContentType', 'vector')

请先登录,再进行评论。

回答(1 个)

Shreshth
Shreshth 2023-11-23
Hello Ahmed,
When using MATLAB to copy 3D plots to other software like Illustrator, there are a few considerations to keep in mind. The issue you are encountering is due to the difference in handling 3D data compared to 2D data.
To copy a 3D plot from MATLAB to Illustrator, you can follow these steps:
1.Exporting 3D Plot as an Image File:
Instead of using the clipboard, you can export the 3D plot as an image file directly from MATLAB. This can be done using the saveas function. For example:
figure;
% Create your 3D plot using plot3() command
plot3(x, y, z, 'b', 'LineWidth', 2);
% Save the plot as an image file
saveas(gcf, '3D_plot.png');
Replace x, y, and z with your actual data and adjust the plot settings as needed.
2.Importing the Image into Illustrator:
After saving the image file, you can import it into Adobe Illustrator using the "File" > "Place" option. This will allow you to use the 3D plot in your Illustrator project.
3.Using MATLAB's Simulink 3D Animation:
If you want to work with interactive 3D content, you can consider using MATLAB's Simulink 3D Animation capabilities. Simulink 3D Animation provides tools to create and animate 3D scenes, which can be exported to various formats for use in other applications.
By following these steps, you should be able to effectively use 3D plots from MATLAB in Adobe Illustrator.
You can also refer to MATLAB’s documentation for exporting graphics at the below link.
Thank you,
Shubham Shreshth.

类别

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

产品

Community Treasure Hunt

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

Start Hunting!

Translated by