Matlab: trying to fix the "RGB color data not yet supported in Painter's mode" warning -


i'm trying use export_fig matlab tool export matlab figures in vector format (pdf or eps).

when trying that, "warning: rgb color data not yet supported in painter's mode" , none of colored parts shown.

the author has addressed issue in readme.md (in package) with

**rgb color data not yet supported in painter's mode** - see warning if try export figure contains patch objects face or vertex colors specified rgb colour, rather index colormap, using painters renderer (the default renderer vector output). problem can arise if use `pcolor`, example. problem matlab's painters renderer, affects `print`; there no fix available in export_fig (other export bitmap). suggested workaround avoid colouring patches using rgb. first, try use colours in figure's colourmap (instructions [here](http://www.mathworks.co.uk/support/solutions/en/data/1-6otpqe/)) - change colourmap, if necessary. if using `pcolor`, try using [uimagesc](http://www.mathworks.com/matlabcentral/fileexchange/11368) (on file exchange) instead.   

and in http://www.mathworks.co.uk/support/solutions/en/data/1-6otpqe/ have accepted solution

s = surf(peaks(50), 'cdata', cat(3, 0.8*ones(50), ones(50), 0.65*ones(50))); rgb_colors = get(s, 'cdata'); [i, map] = rgb2ind(rgb_colors, 64); set(s, 'cdata', double(i)); colormap(map); 

now have figure has contour lines , problem might way i'm accessing handles, because trying this:

>> h = findobj(gca, 'type', 'line')  h =     empty matrix: 0-by-1 

i.e. no lines found. i'm using this:

>> h = get(gca, 'children') 

and then, convert colors, i'll use subsequent lines forum post, give error:

>> [i, map] = rgb2ind(rgb_colors, 64) error using cq first input must uint8 array.  error in rgb2ind (line 89)         [map,x] = cq(rgb,m); 

i'll output contents of rgb_colors:

>> rgb_colors rgb_colors =       [2x451x3   double]     [2x480x3   double]     [2x359x3   double]     [2x311x3   double]     [2x279x3   double]     [2x263x3   double]     [2x259x3   double]     [2x253x3   double]     [2x261x3   double]     [2x269x3   double]     [2x260x3   double]     [2x261x3   double]     [2x261x3   double]     [2x259x3   double]     [2x263x3   double]     [2x259x3   double]     [2x259x3   double]     [2x253x3   double]     [2x255x3   double]     [2x255x3   double]     [2x255x3   double]     [3x34577x3 double]     [] 

and i'm sorry if basic, don't have experience in matlab.


Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -