Documentation Center

  • Trial Software
  • Product Updates

LineColor, LineColor2

Color of lines

Value Summary

LineColor, LineColor2InheritedColor

Graphics Primitives

ObjectsDefault Values
plot::Bars2d, plot::Histogram2d, plot::Piechart2d

LineColor: RGB::Black

plot::Cylindrical, plot::Dodecahedron, plot::Function3d, plot::Hexahedron, plot::Icosahedron, plot::Matrixplot, plot::Octahedron, plot::Prism, plot::Pyramid, plot::Spherical, plot::Surface, plot::SurfaceSet, plot::SurfaceSTL, plot::Sweep, plot::Tetrahedron, plot::Tube, plot::XRotate, plot::ZRotate

LineColor: RGB::Black.[0.25]

LineColor2: RGB::DeepPink

plot::Arc2d, plot::Arrow2d, plot::Arrow3d, plot::Circle2d, plot::Circle3d, plot::Density, plot::Ellipse2d, plot::Inequality, plot::Line2d, plot::Line3d, plot::Lsys, plot::Parallelogram2d, plot::Raster, plot::Rectangle, plot::Rootlocus, plot::Turtle

LineColor: RGB::Blue

plot::Arc3d, plot::Conformal, plot::Curve2d, plot::Curve3d, plot::Ellipse3d, plot::Function2d, plot::Implicit2d, plot::Listplot, plot::Polar, plot::Polygon2d, plot::Polygon3d, plot::Sequence, plot::Sum, plot::VectorField2d, plot::VectorField3d

LineColor: RGB::Blue

LineColor2: RGB::DeepPink

plot::Bars3d, plot::Box, plot::Cone, plot::Cylinder, plot::Parallelogram3d, plot::Piechart3d, plot::Plane

LineColor: RGB::Black.[0.25]

plot::QQplot, plot::Scatterplot

LineColor: RGB::Red

plot::Iteration

LineColor: RGB::Grey50

plot::Implicit3d

LineColor: RGB::Black.[0.15]

LineColor2: RGB::DeepPink

plot::Waterman

LineColor: RGB::Grey40.[0.4]

LineColor2: RGB::DeepPink

plot::Streamlines2d

LineColor: RGB::Black

LineColor2: RGB::DeepPink

plot::Integral

LineColor: RGB::Black

LineColor2: RGB::Grey

Description

LineColor sets the color of line objects such as 2D function graphs, curves in 2D and 3D, parameter lines on surfaces etc.

LineColor2 is a secondary color used for color blends.

LineColor determines the RGB color of line objects. The RGB library provides many pre-defined colors such as RGB::Red etc. See the section Colors of this document for more information on colors.

For pure line objects such as lines, curves, arrows, 2D function graphs etc., the line color can also be set by the attribute Color.

For surface objects such as 3D function graphs, surfaces etc., however, the attribute Color sets the FillColor. If you wish to change the color of the parameter lines on a surface, you have to use LineColor.

The RGB color set by LineColor cannot be animated. However, setting LineColorType = Functional, you can define a LineColorFunction that overrides the color set by LineColor. The line color function accepts an animation parameter, thus allowing to implement animated coloring of lines. See the help page of LineColorFunction for further details.

When the attribute LineColorType is set to one of the values Dichromatic or Rainbow, many line objects react to a secondary color set by the attribute LineColor2.

A gradient between the colors defined by LineColor and LineColor2 is created.

The color of the coordinate axes is set by the attribute AxesLineColor.

Examples

Example 1

We draw arrows of different colors:

plot(plot::Arrow2d([0, 0], [1, 2], LineColor = RGB::Red),
     plot::Arrow2d([0, 0], [1, 1], LineColor = RGB::Green),
     plot::Arrow2d([0, 0], [2, 1], LineColor = RGB::Blue)):

Example 2

We draw a parabola with a gradient between green and blue:

plot(plot::Function2d(x^2, x = 1..10, 
                      LineColorType = Dichromatic, 
                      LineColor = RGB::Green, 
                      LineColor2 = RGB::Blue)):

Example 3

As with any attribute, the line color can be read and changed using the ::-notation:

p := plot::Line2d([1, 2], [4, 5]):
p::LineColor := RGB::Blue

p::LineColor

delete p:

Example 4

For surface objects such as 3D function graphs, LineColor sets the color of the parameter lines on the surface. Here, a semi-transparent RGBa color is chosen that gives only a faint indication of these lines:

plot(plot::Function3d(x^2 + y^2, x = -1..1, y = -1 ..1,
                      LineColor = RGB::Green.[0.25])):

See Also

MuPAD Functions

Was this topic helpful?