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

조회 수: 1 (최근 30일)
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
Walter Roberson
Walter Roberson 2011년 11월 3일
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일
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일
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
Spigge
Spigge 2014년 8월 7일
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

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


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

Michael Backmann
Michael Backmann 2011년 11월 3일
@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

Oliver Woodford
Oliver Woodford 2012년 3월 25일
I added a paragraph in this issue to the export_fig webpage: http://sites.google.com/site/oliverwoodford/software/export_fig

카테고리

Help CenterFile Exchange에서 Graphics Performance에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by