export_fig Warning: RGB color data not yet supported in Painter's mode

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

댓글 수: 1

Your link is to a .rar file, which reduces the number of people who will download it. For example my system does not handle .rar files.

댓글을 달려면 로그인하십시오.

 채택된 답변

Qiaonan Duan
Qiaonan Duan 2013년 7월 25일
편집: Qiaonan Duan 2013년 7월 25일

1 개 추천

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.

추가 답변 (4개)

Jan
Jan 2011년 11월 3일

2 개 추천

This is not a problem of export_fig, but of the export of vector graphics: With the OpenGL and ZBuffer renderers you can create nice 3D graphics using RGB values to define the colors of objects. But then you can export pixel graphics only.
To create scalable vector graphics for the PDF export, the Painters renderer is used. But then you cannot use a Z-buffer painting, transparency and shaded RGB colors.
But you can use indexed colors with the Painters renderer, see Solution 1-6OTPQE

댓글 수: 1

The post is old but this issue continues to cause problems. I want to export to pfd or eps but I get the same warnings (42 of them to be precise) and a poor quality as a result. How can I identify ALL objects that need to be coverted to indexed color? I have several hundered graphical objects of different types in my application. I have tried using findall(gcf,'type','patch') but only 12 out of the 42 warnings seem to be caused by patch objects. What else should I look for and can I use the same fix as Solution 1-6OTPQE for all types of identified objects?
Thanks
Fredrik

댓글을 달려면 로그인하십시오.

Before calling export_fig, try
set(gcf, 'Renderer', 'zbuffer')
drawnow();
Michael Backmann
Michael Backmann 2011년 11월 3일

0 개 추천

@Walter: your solution didn't work. but thanks anyway!
@Jan: that was to much input for me! I tried to copy the example of "Solution 1-6OTPQE" directly above the export_fig line, but all stays the same.
Could you please take a look on my plotting file. maybe you find the error. here is the m-file:
-The figure plot is on line 31. The contour plot is on line 133-200 (for variable 'pr') and i try to save the plot on line 396-408.
I'm so confused! please help!
thx, -michael

카테고리

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

질문:

2011년 11월 3일

댓글:

2014년 8월 7일

Community Treasure Hunt

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

Start Hunting!

Translated by