Skip to content

whitebg

plot · scripts/plot/appearance/whitebg.m

: whitebg ()
: whitebg (fig)
: whitebg (color)
: whitebg (fig, color)

Change the background color of a figure and the foreground colors that contrast with it.

Without color the background is complemented: a light background becomes black and a dark one white. color is an RGB triplet in [0, 1] or a color name such as "k", "white" or "r". The figure color and the color of every axes in the figure are set to the background, and axis lines, tick labels and the labels and titles of the axes to black on a light background and white on a dark one. The figure’s default axes and text colors are updated so that axes created later match.