rgb2cm - Fix RGB color data in Painter's mode
Painter's mode rendering is required for copying a figure to the clipboard as an EMF (vector format) or printing to vector-format files such as PDF and EPS. However, if the colours of any patches in your figure are represented using CData and an RGB colour code, these will not show in the copied figure. You may also get a warning like:
Warning: RGB color data not yet supported in Painter's mode
The solution is to change these specific patches to use an index into the colormap. That's what this script does. For each patch using RGB, it adds those colours to the colormap and changes the patch to use a colormap index.
Cite As
Robbie Andrew (2024). rgb2cm - Fix RGB color data in Painter's mode (https://www.mathworks.com/matlabcentral/fileexchange/35469-rgb2cm-fix-rgb-color-data-in-painter-s-mode), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
- MATLAB > Graphics > Formatting and Annotation > 3-D Scene Control > Lighting, Transparency, and Shading >
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.