Export figure is painfully slow. Save as png is fast. Why?

25 次查看(过去 30 天)
I tend to export some figures for use in presentations etc. I have noticed that for some figures (perhaps those with lots of data), Matlab will grind to a halt when I try to export the image to the OS pasting buffer. Sometimes I end up killing the Matlab session.
Recently, I figured out that if I instead save the image as e.g. *.png, it is really fast. Any idea why this is? Is it a bug? How hard can it be to render into a VGA-ish image buffer?

采纳的回答

Patrick Kalita
Patrick Kalita 2011-6-20
The reason is that MATLAB is not exactly rendering to a "VGA-ish image buffer" when you copy to clipboard. The default setting is for MATLAB to attempt to copy in a Windows Metafile format. This format mixes vector and bitmap elements. So, yeah, if you have a lot of data and it is trying to encode those in a vector format, it could take a while.
You do have control over the format MATLAB uses for figure copying. In a figure window select Edit -> Copy Options. In the Preferences dialog that opens if you select "Bitmap" you will get a simple bitmap version of the figure copied to the clipboard -- which should be faster.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Printing and Saving 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by