whitebg

Purpose

Change figure background color.

Synopsis

whitebg
whitebg(fig)
whitebg(c)
whitbg(fig,c)

Description

whitebg toggles the background color of the current figure between white and black. The command also changes other figure properties, including text and axes color, to ensure that all objects are visible.

whitebg(fig), where fig is a row vector of figure handles, toggles all the specified figures. The function sets the default properties of the root window such that all subsequent figure plots use the new background color.

whitebg(c) and whitebg(fig,c) change the default background color to c, where c can be an RGB triple like [1 0 0] or a color name string like 'white' (see the ColorSpec reference page for details on specifying colors).

This command also affects other figure properties so text and graphics are visible against the new background color. See the figure reference description (InvertHardCopy property) for details on printing the contents of a figure window.

See Also

figure

(c) Copyright 1994 by The MathWorks, Inc.