How to create manageable sized images from 3d mesh plots with a lot of data?

8 views (last 30 days)
I have to make vector graphic images (pdf or eps) for a scientific publication. But my image is formed by four mesh plots in a 2x2 subplot, each from a 200x200 zdata.
After using the export setup to get the final figure as a vectorized eps, the image gets around 30MB and impossible to use in a text software.
Follows the export setup for more clear reference of the process:
Is there any way to turn 3d mesh plots into 2d images so the vectorized eps does not get too heavy? Or any other way to deal with creating vector graphic images from large data mesh?
Thank you.

Answers (1)

Dheeraj
Dheeraj on 9 Aug 2023
Hi,
2D images from 3D mesh plots from a large data can be created in more efficient manner if the 3d plot is exported as a raster image.
The below code demonstrates how to save a plot as raster image
% Creating dummy data for the mesh
[x, y] = meshgrid(-2:0.1:2, -2:0.1:2);
z = sin(sqrt(x.^2 + y.^2));
% Creating a 3D mesh plot
figure;
mesh(x, y, z);
xlabel('X-axis');
ylabel('Y-axis');
zlabel('Z-axis');
title('3D Mesh Plot');
% Save the plot as raster image (JPEG) with the resolution of your choice
print('simple_3d_plot', '-djpeg', '-r300');
Doing this would significantly reduce file size as intended compared to vector formats like EPS.

Tags

Products


Release

R2023a

Community Treasure Hunt

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

Start Hunting!