GTBlueRed[x]
defines a ColorFunction from blue (x=0) to red (x=1).
Details and Options
Examples
Basic Examples
See Also
Related Guides
GroupTheory`
GroupTheory`
GTBlueRed
GTBlueRed[x]
defines a ColorFunction from blue (x=0) to red (x=1).
Details and Options
- The code MPB (MIT Photonic-Bands) uses a special color code to represent the amplitudes of the electromagnetic fields. GTBlueRed simulates this color code to represent the fields in the same manner within GTPack.
- x =0 corresponde to Blue, x=1/2 gives White and x=1 corresponds to Red.
- See: W. Hergert, M. Geilhufe, Group Theory in Solid State Physics and Photonics. Problem Solving with Mathematica
- MPB: https://mpb.readthedocs.io/en/latest/Data_Analysis_Tutorial/
Examples
Basic Examples (1)
Needs["GroupTheory`"]The color bar demonstrates the color change in dependence on x.
col = Table[GTBlueRed[x], {x, 0, 1, 1 / 100}];ArrayPlot[{col}]The defined color scheme can be used as a ColorFunction in the standard Plot commands of Mathematica.
g1 = ContourPlot[Sin[x]Cos[y], {x, -π, π}, {y, -π, π}, Contours -> 50, ContourLines -> False];g2 = ContourPlot[Sin[x]Cos[y], {x, -π, π}, {y, -π, π}, ColorFunction -> GTBlueRed, Contours -> 50, ContourLines -> False];
Grid[{{g1, g2}}]