export_fig Warning: RGB color data not yet supported in Painter's mode
2 次查看(过去 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
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
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
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.
1 个评论
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
2011-11-3
Before calling export_fig, try
set(gcf, 'Renderer', 'zbuffer')
drawnow();
0 个评论
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
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Blue 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!