is an option for graphics functions that specifies a function to apply to determine opacity of elements.
OpacityFunction
is an option for graphics functions that specifies a function to apply to determine opacity of elements.
Details
- With OpacityFunctionfunc, the arguments supplied to func are as follows:
-
DensityPlot3D, ListDensityPlot3D f - Typical settings for OpacityFunction include:
-
Automatic automatically determined None no opacity function, fully opaque α constant opacity Opacity[α] Interval[…] make values in the interval more opaque "Image3D" default opacity function used in Image3D func general opacity function
Examples
Basic Examples (3)
The Automatic setting attempts to create approximately 80% transparency in the volume:
DensityPlot3D[x ^ 2 + y ^ 2 + z ^ 2, {x, -2, 2}, {y, -2, 2}, {z, -2, 2}, OpacityFunction -> Automatic, PlotLegends -> Automatic]Use None to get a fully opaque visualization:
DensityPlot3D[Sin[π x]Sin[π (y + z)], {x, -2, 2}, {y, -2, 2}, {z, -2, 2}, OpacityFunction -> None]Set opacity as a function
of the scaled function value f:
DensityPlot3D[x y z, {x, -1, 1}, {y, -1, 1}, {z, -1, 1}, OpacityFunction -> Function[f, (1 - f) ^ 2]]History
Text
Wolfram Research (2015), OpacityFunction, Wolfram Language function, https://reference.wolfram.com/language/ref/OpacityFunction.html.
CMS
Wolfram Language. 2015. "OpacityFunction." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/OpacityFunction.html.
APA
Wolfram Language. (2015). OpacityFunction. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/OpacityFunction.html
BibTeX
@misc{reference.wolfram_2026_opacityfunction, author="Wolfram Research", title="{OpacityFunction}", year="2015", howpublished="\url{https://reference.wolfram.com/language/ref/OpacityFunction.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_opacityfunction, organization={Wolfram Research}, title={OpacityFunction}, year={2015}, url={https://reference.wolfram.com/language/ref/OpacityFunction.html}, note=[Accessed: 12-June-2026]}