Error when using exportgraphics function to save large vector graphics with transparency

8 Ansichten (letzte 30 Tage)
When I tried to save a large vector graphic with transparency information using the exportgraphics function on my PC, an error occurred.
MATLAB version: 9.12.0.2529717 (R2022a) Update 8
Operating system: Microsoft Windows 10 Pro Version 10.0 (Build 19045)
Java version: Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
After plotting a large 3D vector graphic with complex perspectives and transparency relationships in a figure, I attempted to run the following code to save the figure:
exportgraphics(gca, 'picture1.emf', 'BackgroundColor', 'none', 'ContentType', 'vector')
However, the program threw an error.
The error message was:
Problem while processing in an OutputHelper. java.nio.file.NoSuchFileException:
C:\Users\room250\AppData\Local\Temp\emf6382030724281275533.tmp
com.mathworks.hg.util.OutputHelperProcessingException: Problem while processing in an
OutputHelper. java.nio.file.NoSuchFileException:
C:\Users\room250\AppData\Local\Temp\emf6382030724281275533.tmp
at com.mathworks.hg.util.HGVectorOutputHelper.close(HGVectorOutputHelper.java:245)
Caused by: com.mathworks.hg.print.OutputProcessingException: java.nio.file.NoSuchFileException:
C:\Users\room250\AppData\Local\Temp\emf6382030724281275533.tmp
at com.mathworks.hg.print.MWEMFVectorStrategy.endJob(MWEMFVectorStrategy.java:144)
at com.mathworks.hg.util.HGVectorOutputHelper.close(HGVectorOutputHelper.java:241)
Caused by: java.nio.file.NoSuchFileException:
C:\Users\room250\AppData\Local\Temp\emf6382030724281275533.tmp
at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:79)
at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97)
at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102)
at sun.nio.fs.WindowsFileSystemProvider.newByteChannel(WindowsFileSystemProvider.java:230)
at java.nio.file.Files.newByteChannel(Files.java:361)
at java.nio.file.Files.newByteChannel(Files.java:407)
at java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:384)
at java.nio.file.Files.newInputStream(Files.java:152)
at java.nio.file.Files.copy(Files.java:3068)
at com.mathworks.hg.print.MWEMFVectorStrategy.endJob(MWEMFVectorStrategy.java:142)
... 1 more
I tried running MATLAB as an administrator and on a PC with higher memory, but the error persisted, and the error message remained the same. In addition, I checked the available storage space on my computer, and I have at least 390 GB of free space.
When I saved the same figure without transparency information as an image (using
exportgraphics(gca, 'picture1.emf', 'BackgroundColor', 'none', 'ContentType', 'image')
), the exportgraphics function worked correctly.
Furthermore, I plotted a smaller image and tried again to save it using
exportgraphics(gca, 'picture1.emf', 'BackgroundColor', 'none', 'ContentType', 'vector')
, and the result was correct.
So, it seems that the exportgraphics function may not support saving larger images, or is there another reason?
  2 Kommentare
埃博拉酱
埃博拉酱 am 25 Jan. 2025
你可以把你的图存为fig格式上传过来以便我复现此问题吗?
敬 杨
敬 杨 am 26 Jan. 2025
当然,但是文件的大小(25.9MB)超过了上传的限制,我将他放在了如下的链接

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

埃博拉酱
埃博拉酱 am 26 Jan. 2025
Bearbeitet: 埃博拉酱 am 26 Jan. 2025
我使用了你提供的文件,测试了你的第一行代码,但是在更新的MATLAB版本和操作系统环境上:
------------------------------------------------------------------------------------------------
MATLAB 版本: 25.1.0.2833191 (R2025a) Prerelease Update 2
MATLAB 许可证编号: Prerelease
操作系统: Microsoft Windows 11 专业版 Insider Preview Version 10.0 (Build 27774)
Java 版本: Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
------------------------------------------------------------------------------------------------
并没有遇到任何错误,成功输出了EMF,并且可以插入到Word中查看。你或许需要尝试更新的MATLAB版本,以包含潜在的bug修复。

Weitere Antworten (0)

Kategorien

Mehr zu Printing and Saving finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by