Exporting high res pcolor to eps bugs out

4 views (last 30 days)
HC98
HC98 on 1 Mar 2024
Edited: Gyan Vaibhav on 6 Mar 2024
I have a high resolution pcolor plot produced with about 1000 intervals on the y-axis. I'm trying to export it to eps with
print -painters -depsc tmax_contour.eps
but it either crashes or prodices a blank file...

Answers (1)

Gyan Vaibhav
Gyan Vaibhav on 6 Mar 2024
Edited: Gyan Vaibhav on 6 Mar 2024
Hi HC98,
I tried reproducing the error and indeed MATLAB crashes due to out of memory error.
For exporting such high resolution plot you can try the following.
  1. Reduce complexity: If possible, consider reducing the complexity of the plot before exporting. This could mean decreasing the number of intervals or using data that is less dense. While this might not be ideal as it could reduce the detail of your plot, it could be a practical workaround.
  2. Though "-painters" is equivalent to "-vector", after changing to -vector my MATLAB didn't crash, but I felt it didn't completely write the data and outputs a few warnings. So, firstly try changing the "-painters" to "-vector". Hopefully it prints your data correctly.
  3. Change Renderer: Try using a different renderer. Although -painters is preferred for vector graphics, in cases where it fails, you might want to fall back to the -opengl or -image. While these will produce a rasterized image in your EPS, they might handle the complexity better. You can specify the resolution with the -r flag to maintain as much detail as possible.
print -opengl -depsc -r300 tmax_contour.eps
4.If these don't work and you still want the same quality of the file, try closing other applications or trying a different machine with better
specifications to increase the system resources available to MATLAB.
5. Contact Mathworks Technical Support here: https://www.mathworks.com/support/contact_us.html
Thanks,
Hope this helps.
Gyan

Categories

Find more on Graphics Performance in Help Center and File Exchange

Products


Release

R2023b

Community Treasure Hunt

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

Start Hunting!