Background

Background

is an option that specifies what background color to use.

Details

  • The setting for Background can be any color or opacity specification.
  • Background is an option to such functions as Graphics, Plot, Text, Panel, Button, and Cell.
  • When an object has option Background->color, the specified color will normally be used as a background throughout the region defined by the object.
  • Style[expr,Background->color] specifies that color should be used as the background only for the region defined by the bounding box of expr.
  • In constructs such as Grid, Item can be used to specify that a background should fill the complete region for a particular item.
  • In a cell, the background is used only for the region inside any cell frame.
  • Background->None specifies that no background should be used, so that in effect the background is transparent.
  • Background->Automatic specifies a background that follows the system appearance for the particular object or window used. For Inset, Background->Automatic specifies that the background should be taken from the graphic in which it appears.
  • For objects such as Grid, Column, and Row, the setting for Background can be a list that specifies backgrounds for individual columns, rows, or elements.
  • In Dataset, the setting for Background can be a pure function f that returns a color. The setting is given by f[item,position,data], where data is the dataset's first argument.

Examples

open allclose all

Basic Examples  (2)

Insert a background color behind any expression:

A background for graphics:

Scope  (2)

Draw a grid with a light red background:

Draw the first item with a light blue background:

Generalizations & Extensions  (5)

Light blue and light red backgrounds for the first and second horizontal positions:

Light blue and light red backgrounds for the first and last horizontal positions:

Light blue and light red backgrounds for the first and second vertical positions:

Alternating light blue and light red backgrounds:

Alternating background with pink superimposed in the first and last positions:

Set the background for a subregion of the grid:

Color background by value in Dataset:

Applications  (3)

Show a table with alternating row background colors:

Highlight the maximum in each column of a Dataset:

Display a grid of values as a heat map:

Properties & Relations  (1)

Background color can be seen through a transparent object:

Neat Examples  (1)

Show 3D objects against a dark background:

Wolfram Research (1991), Background, Wolfram Language function, https://reference.wolfram.com/language/ref/Background.html (updated 2020).

Text

Wolfram Research (1991), Background, Wolfram Language function, https://reference.wolfram.com/language/ref/Background.html (updated 2020).

CMS

Wolfram Language. 1991. "Background." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2020. https://reference.wolfram.com/language/ref/Background.html.

APA

Wolfram Language. (1991). Background. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Background.html

BibTeX

@misc{reference.wolfram_2024_background, author="Wolfram Research", title="{Background}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/Background.html}", note=[Accessed: 07-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_background, organization={Wolfram Research}, title={Background}, year={2020}, url={https://reference.wolfram.com/language/ref/Background.html}, note=[Accessed: 07-November-2024 ]}