Closed hirothreading closed 2 years ago
Try to reinstall Ghostscript
I'm facing a similar error. the output .png file is totally nothing. All output file has an exactly 107b size. I'm using MBP2021 m1 max, with MATLAB R2021b, the version of export_fig is 3.21 I tried install Ghostscript “Ghostscript-9.55-Full.pkg” from 'http://pages.uoregon.edu/koch'. The problem is still.
Installed GhostScript, but still getting the same issues
Same problem here. It's not every figure, but it is most of them. I've tried reinstalling ghostscript; no luck.
Same issue here on M1 Air. I've played around with the gcf color set because I first thought the script was somehow coloring the entire figure white and in doing so found that the figures/files to which this happens will arbitrarily shift. Giving the transparent option however always results in an empty file of size 107B, as stated before.
Try to run export_fig using the software emulation of opengl and see if this resolves the problem:
opengl software % temporarily switch to opengl emulation mode
export_fig(...);
opengl hardware % switch back to using opengl hardware acceleration
Try to run export_fig using the software emulation of opengl and see if this resolves the problem:
opengl software % temporarily switch to opengl emulation mode export_fig(...); opengl hardware % switch back to using opengl hardware acceleration
I have done as you suggested, but Matlab returns the following error:
Error using opengl Switching to software OpenGL rendering is not supported on the Mac platform.
Try the following and let me know what you see:
print2eps([tempdir '/check1.eps'], gcf); % alternative 1
print(gcf, '-loose', '-depsc2', [tempdir '/check2.eps']); % alternative 2
print(gcf, '-loose', '-painters', '-r864', '-depsc2', [tempdir '/check3.eps']); % alternative 3
I saved to EPS using export_fig command and got a 0.58MB file with nothing but a few white pixels in it. I've attached it for your viewing pleasure (zipped because .eps is not natively supported by GitHub).
All of the alternative commands you offered did work successfully and gave the expected image! 1 & 2 gave a 1.1MB file, 3 was 0.2MB. Would love to be able to export as PNGs though :)
Thank you for your help and responsiveness!
This is possibly the same problem as issues #318, #351 - try to modify the pause duration in print2eps.m line 543 from 0.02 to 0.1 or 0.2 and check if this resolves the problem.
I uploaded v3.25 that hopefully resolves the problem on all systems/releases, without a large performance penalty in the common case. I'm closing the issue, but if you find that v3.25 still does not solve the issue then let me know and I'll reopen it.
Not sure if anyone else has ran into this issue, but when attempting to use export_fig on my M1 MacBook Air I just get a bunch of blank files (see attachment). Is this simply a compatibility issue when running MATLAB in Rosetta 2?
FWIW, I have no issues on my Intel-based Mac.