Method gradient
| Improve this Doc View Sourcegradient(Double[], Double[], Double)
plgradient: Draw linear gradient inside polygon
Declaration
public void gradient(Double[] x, Double[] y, Double angle)
Parameters
Type | Name | Description |
---|---|---|
Double[] | x | A vector containing the x coordinates of vertices. |
Double[] | y | A vector containing the y coordinates of vertices. |
Double | angle | Angle (degrees) of gradient vector from x axis. |
Remarks
Draw a linear gradient using cmap1 inside the polygon defined by the n points (x[i], y[i]). Interpretation of the polygon is the same as for plfill. The polygon coordinates and the gradient angle are all expressed in world coordinates. The angle from the x axis for both the rotated coordinate system and the gradient vector is specified by angle. The magnitude of the gradient vector is the difference between the maximum and minimum values of x for the vertices in the rotated coordinate system. The origin of the gradient vector can be interpreted as being anywhere on the line corresponding to the minimum x value for the vertices in the rotated coordinate system. The distance along the gradient vector is linearly transformed to the independent variable of color map 1 which ranges from 0. at the tail of the gradient vector to 1. at the head of the gradient vector. What is drawn is the RGBA color corresponding to the independent variable of cmap1. For more information about cmap1 (see ).