MATLAB: Export_fig Warning: RGB color data not yet supported in Painter’s mode

export_figrenderers

Hi!
I'm using the function 'export_fig' to save my figures in pdf format. When I try to save, it shows me this error:
"Warning: RGB color data not yet supported in Painter's mode
In legendcolorbarlayout>doParentResize at 335
In /usr/site/hpc/x86_64/glibc-2.5/generic/matlab/R2011a/toolbox/matlab/graphics/hardcopy.p>hardcopy at 22
In graphics/private/render at 142
In print>LocalPrint at 271
In print at 228
In print2eps at 42
In export_fig at 377
In vertical_plot at 404
In main_function at 166"
This Warning is repeated for maybe 30 times. Then the figure is saved to pdf, but the contourplot is missing. -only the edges of the contourplot are visible. You can download the original figure and the pdf file on this link:
How can I fix this problem?
Im using MATLAB 7.12.0 (R2011a) on a supercomputer. Ghostscript 8.70-6.e15 is installed.
Thank you!
-Michael

Best Answer

My solution is to add all your colors to colormap. Then index them when ploting.
For example, for a scatter plot:
cmap = .....; %self defined colormap
colorIdx = ....; %map color to each dot by index
colormap(cmap); %change colormap variable to customized colormap
scatter(X,Y,s,colormap); % This scatter plot is able to export as eps.