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

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일

0 개 추천

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개)

카테고리

도움말 센터File Exchange에서 Images에 대해 자세히 알아보기

태그

질문:

2011년 6월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by