ColorDataFunction
✖
ColorDataFunction
Details

- ColorDataFunction works like Function.
- ColorDataFunction[…][par] finds the color corresponding to parameter par in the color scheme represented by the ColorDataFunction.
- ColorData["scheme"] gives a ColorDataFunction object.
Examples
open allclose allBasic Examples (3)Summary of the most common use cases
ColorData returns a ColorDataFunction object:

https://wolfram.com/xid/0g7eohamiky-ccjgse

Return a color when the specific parameters are applied:

https://wolfram.com/xid/0g7eohamiky-hncaxn


https://wolfram.com/xid/0g7eohamiky-jbm3io

Define a color function for the plot:

https://wolfram.com/xid/0g7eohamiky-c0baku


https://wolfram.com/xid/0g7eohamiky-eskj2e

Scope (5)Survey of the scope of standard use cases
ColorData returns a ColorDataFunction object:

https://wolfram.com/xid/0g7eohamiky-j0qfyo


https://wolfram.com/xid/0g7eohamiky-bdq43v


https://wolfram.com/xid/0g7eohamiky-d9jhx3


https://wolfram.com/xid/0g7eohamiky-mx7q0j

ColorDataFunction returns RGB colors when applied to values within a specific range:

https://wolfram.com/xid/0g7eohamiky-edxxuz


https://wolfram.com/xid/0g7eohamiky-ce2mpf


https://wolfram.com/xid/0g7eohamiky-lpszj1


https://wolfram.com/xid/0g7eohamiky-iisfha

Gradients and physical schemes are defined on continuous intervals:

https://wolfram.com/xid/0g7eohamiky-ctvw0k


https://wolfram.com/xid/0g7eohamiky-e77nsy


https://wolfram.com/xid/0g7eohamiky-pfzait


https://wolfram.com/xid/0g7eohamiky-pp7mq


https://wolfram.com/xid/0g7eohamiky-joa0d2


https://wolfram.com/xid/0g7eohamiky-oempn4

Indexed schemes are defined at discrete values:

https://wolfram.com/xid/0g7eohamiky-ed5y91


https://wolfram.com/xid/0g7eohamiky-csrry1


https://wolfram.com/xid/0g7eohamiky-cqqhlb


https://wolfram.com/xid/0g7eohamiky-debhod

Named schemes are defined at specific sets of values:

https://wolfram.com/xid/0g7eohamiky-l6vpd


https://wolfram.com/xid/0g7eohamiky-jkvczz


https://wolfram.com/xid/0g7eohamiky-bmqbsw

Properties & Relations (2)Properties of the function, and connections to other functions
ColorDataFunction from gradients and physical schemes clips values outside of the ranges:

https://wolfram.com/xid/0g7eohamiky-h5h2hy


https://wolfram.com/xid/0g7eohamiky-88m2g

ColorDataFunction from indexed schemes repeats the colors periodically:

https://wolfram.com/xid/0g7eohamiky-fhqyfe


https://wolfram.com/xid/0g7eohamiky-imjn8v

Possible Issues (1)Common pitfalls and unexpected behavior
In a plot with multiple ColorFunction slots, the first slot is chosen, if not specified:

https://wolfram.com/xid/0g7eohamiky-k6rmxs


https://wolfram.com/xid/0g7eohamiky-fl29rw

Specify a pure function so that the plot is colored by height values:

https://wolfram.com/xid/0g7eohamiky-glb4h8

Wolfram Research (2007), ColorDataFunction, Wolfram Language function, https://reference.wolfram.com/language/ref/ColorDataFunction.html.
Text
Wolfram Research (2007), ColorDataFunction, Wolfram Language function, https://reference.wolfram.com/language/ref/ColorDataFunction.html.
Wolfram Research (2007), ColorDataFunction, Wolfram Language function, https://reference.wolfram.com/language/ref/ColorDataFunction.html.
CMS
Wolfram Language. 2007. "ColorDataFunction." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ColorDataFunction.html.
Wolfram Language. 2007. "ColorDataFunction." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ColorDataFunction.html.
APA
Wolfram Language. (2007). ColorDataFunction. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ColorDataFunction.html
Wolfram Language. (2007). ColorDataFunction. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ColorDataFunction.html
BibTeX
@misc{reference.wolfram_2025_colordatafunction, author="Wolfram Research", title="{ColorDataFunction}", year="2007", howpublished="\url{https://reference.wolfram.com/language/ref/ColorDataFunction.html}", note=[Accessed: 17-May-2025
]}
BibLaTeX
@online{reference.wolfram_2025_colordatafunction, organization={Wolfram Research}, title={ColorDataFunction}, year={2007}, url={https://reference.wolfram.com/language/ref/ColorDataFunction.html}, note=[Accessed: 17-May-2025
]}