MATLAB: How to copy a figure with patches that have RGB ‘CData’ to the clipboard in MATLAB 7.1 (R14SP3)

hanghangsMATLABstuck

I have a figure which includes PATCH objects whose 'CData' property is specified as RGB colors. When I attempt to copy this figure using the "Copy Figure" item from the "File" menu, it takes a long time to execute.
During the time when MATLAB is occupied with this task, the MATLAB status bar may display "Busy", and many warnings such as:
Warning: RGB color data not yet supported in Painter's mode.
are produced. The behavior is the same whether the 'painters' renderer is used, or not.
When pasted, the resulting image is missing the PATCH objects.

Best Answer

The renderer used in this exporting process is chosen according to the "Clipboard format" preference located at
File->Preferences->Copy Template->Copy Options
(This can be different from the renderer used on-screen.) When this preference is set to "Metafile" or "Preserve information", the 'painters' renderer may be used (it is always used in the former case, sometimes in the latter).
However, the 'painters' renderer does not support rendering patches with RGB 'CData', and this results in the slow processing and warning messages.
Instead, you can force MATLAB to use another renderer during the export process. One way to do this is to select "Bitmap" for the "Clipboard format" option. Alternatively, you can export to the clipboard from the MATLAB command line by using the statement:
print -dbitmap