MATLAB: Is the background color of the figure ignored when I select “Print to Figure” when using CFTOOL in Curve Fitting Toolbox 1.1.6 (R2006b)

Curve Fitting Toolbox

I am creating a figure using CFTOOL, then print it to figure using "File–> Print to Figure".
If I change the color of the background by going to the figure property, the RGB values are changed; however, the color of the background is still grey. I also tried to create a handle to the figure and change the 'color' property. This returns the same result. If I query the 'Color' property using the GET function, the modified value is returned; however the figure background is still grey.

Best Answer

The ability to change the color of the figure generated using "Print to Figure" from CFTOOL in Curve Fitting Toolbox 1.1.6 (R2006b) is not directly available.
The reason for this is that the "Print to Figure" option creates a MATLAB figure that is embedded in a UICONTAINER object. This does not happen when using a regular MATLAB figure.
This issue has been fixed in Curve Fitting Toolbox 1.1.7 (R2007a).
If you are using a previous version, you may work around this issue by setting the 'Background Color' property of the UICONTAINER as follows:
Right after printing to figure execute the following commands:
h=get(gca,'parent') % get handle of the uicontainer
set(h,'backgroundcolor','w') % set the background color to white