i've tried: set(gca,'color','r') with no change. I've attempted to assign a handle to the Patch Face however matlab doesn't seem to recognize the property. Any and all help is greatly appreciated.
Some script so it may make more sense of what i'm creating:
m_proj('equidistand cylindrical','long',lonrange,'lat',latrange);
m_pcolor(lon(:,:),lat(:,:),DATA(:,:));
shading flat
set(gca,'visible','off); %tried it on with 'on' with no coloration difference
m_grid('xtick',8,'tickdir...
The map is of the planet and all ocean is listed at 'NaN' so whatever the background color is should show through.
whitebg([.402 .6 1]) %does not change gca color only gcf color when using m_map
Y = get(gca,'color') %returns Y = 1 1 1 (which is true, the figure background is white)
set(Y,'color',[.402 .6 1]) %changes the gcf background color to [.402 .6 1] not gca
Y = get(gca,'color') %Still returns Y = 1 1 1;
I then..
T = get(Y,'color');
T=
{0.402,0.6,1}
{0.402,0.6,1}
{0.402,0.6,1}
I'm not sure where to go from here.
Y = get(gca,'color')
returns an RGB triple (as you point out)
However, Y is not the handle of an axes. However, because Y contains a 1, it
is mistaken for the integer handle of the figure.
The first argument in a call to SET and GET must be the a handle (or an
array of handles). If you want to set the background color of the current
figure, use:
set(gcf,'Color',....)
The statement:
T = get(Y,'color');
returns the color of the figure with integer handle 1 three times.
"David T" <dtra...@gmail.com> wrote in message
news:hlv2u8$5ge$1...@fred.mathworks.com...
I've tried:
set(gcf,'Color',...)
set(gca,'Color',...)
whitebg(gcf,'Color',...);
whitebg(gca,'Color,...);
whitebg(colorspec);
nothing still. . .
The frustrating thing is that i can alter the gridded background color in figure editor to whatever color i want. This means there has to be a handle and a way to do this within a script. I'm beginning to think there is something within the m_mapping package that is stopping me. Would be great to figure this out.
set(0,'ShowHiddenHandles','on')
and get the handle of the object from the figure or axes Children property.
For example, this statement can show you what object are in the current
axes.
get(get(gca,'Children'),'Type')
Also, see the help for the FINDOBJ function:
doc findobj
"David T" <dtra...@gmail.com> wrote in message
news:hm18e1$pvq$1...@fred.mathworks.com...
..and again i wanted this to be fully automated within my script..
T = get(fig,'Children');%third value listed is the gca handle
R = get(T(3,1),'Children');%the 21st value of R is the Patch handle for the background of a plot.
L = R(21,1);
set(L,'FaceColor',[.4 .6 1]);
happy to have that figure out and thanks for the help.
"Rich Ellis" <ri...@mathworks.com> wrote in message <hm1non$p90$1...@fred.mathworks.com>...