---
name: "plshade"
section: "3plplot"
platform: "linux"
package: "plplot-doc"
version: "5.15.0+dfsg2-15"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/plshade"
---

# plshade(3plplot)

Shade individual region on the basis of value

## NAME

**plshade** - Shade individual region on the basis of value

## SYNOPSIS

**plshade**(*a*, *nx*, *ny*, *defined*, *xmin*, *xmax*, *ymin*, *ymax*, *shade\_min*, *shade\_max*, *sh\_cmap*, *sh\_color*, *sh\_width*, *min\_color*, *min\_width*, *max\_color*, *max\_width*, *fill*, *rectangular*, *pltr*, *pltr\_data*)

## DESCRIPTION

Shade individual region on the basis of value.  Use [**plshades**(3plplot)](/plshades/3plplot.md) if you want to shade a number of contiguous regions using continuous colors.  In particular the edge contours are treated properly in [**plshades**(3plplot)](/plshades/3plplot.md).  If you attempt to do contiguous regions with [**plshade**(3plplot)](/plshade/3plplot.md) the contours at the edge of the shade are partially obliterated by subsequent plots of contiguous shaded regions.

Redacted form: General: **plshade(a, defined, xmin, xmax, ymin, ymax, shade\_min, shade\_max, sh\_cmap, sh\_color, sh\_width, min\_color, min\_width, max\_color, max\_width, fill, rectangular, pltr, pltr\_data)**

This function is used in example 15.

## ARGUMENTS

- *a* (**PLFLT\_MATRIX**(3plplot), input)

  A matrix containing function values to plot.  Should have dimensions of *nx* by *ny*.

- *nx* (**PLINT**(3plplot), input)

  First dimension of the matrix "a".

- *ny* (**PLINT**(3plplot), input)

  Second dimension of the matrix "a".

- *defined* (**PLDEFINED\_callback**(3plplot), input)

  Callback function specifying the region that should be plotted in the shade plot.  This function accepts x and y coordinates as input arguments and must return 1 if the point is to be included in the shade plot and 0 otherwise.  If you want to plot the entire shade plot (the usual case), this argument should be set to NULL.

- *xmin, xmax, ymin, ymax* (**PLFLT**(3plplot), input)

  See the discussion of *pltr* below for how these arguments are used (only for the special case when the callback function *pltr* is not supplied).

- *shade\_min* (**PLFLT**(3plplot), input)

  Defines the lower end of the interval to be shaded. If shade\_max \<= shade\_min, [**plshade**(3plplot)](/plshade/3plplot.md) does nothing.

- *shade\_max* (**PLFLT**(3plplot), input)

  Defines the upper end of the interval to be shaded. If shade\_max \<= shade\_min, [**plshade**(3plplot)](/plshade/3plplot.md) does nothing.

- *sh\_cmap* (**PLINT**(3plplot), input)

  Defines color map. If *sh\_cmap*=0, then *sh\_color* is interpreted as a cmap0 (integer) index.  If *sh\_cmap*=1, then *sh\_color* is interpreted as a cmap1 argument in the range (0.0-1.0).

- *sh\_color* (**PLFLT**(3plplot), input)

  Defines color map index with integer value if cmap0 or value in range (0.0-1.0) if cmap1.

- *sh\_width* (**PLFLT**(3plplot), input)

  Defines width used by the fill pattern.

- *min\_color* (**PLINT**(3plplot), input)

  Defines pen color, width used by the boundary of shaded region. The min values are used for the shade\_min boundary, and the max values are used on the shade\_max boundary.  Set color and width to zero for no plotted boundaries.

- *min\_width* (**PLFLT**(3plplot), input)

  Defines pen color, width used by the boundary of shaded region. The min values are used for the shade\_min boundary, and the max values are used on the shade\_max boundary.  Set color and width to zero for no plotted boundaries.

- *max\_color* (**PLINT**(3plplot), input)

  Defines pen color, width used by the boundary of shaded region. The min values are used for the shade\_min boundary, and the max values are used on the shade\_max boundary.  Set color and width to zero for no plotted boundaries.

- *max\_width* (**PLFLT**(3plplot), input)

  Defines pen color, width used by the boundary of shaded region. The min values are used for the shade\_min boundary, and the max values are used on the shade\_max boundary.  Set color and width to zero for no plotted boundaries.

- *fill* (**PLFILL\_callback**(3plplot), input)

  Routine used to fill the region.  Use [**plfill**(3plplot)](/plfill/3plplot.md).  Future version of PLplot may have other fill routines.

- *rectangular* (**PLBOOL**(3plplot), input)

  Set *rectangular* to true if rectangles map to rectangles after coordinate transformation with *pltrl*.  Otherwise, set *rectangular* to false. If *rectangular* is set to true, plshade tries to save time by filling large rectangles.  This optimization fails if the coordinate transformation distorts the shape of rectangles. For example a plot in polar coordinates has to have *rectangular* set to false.

- *pltr* (**PLTRANSFORM\_callback**(3plplot), input)

  A callback function that defines the transformation between the zero-based indices of the matrix *a* and world coordinates. If *pltr* is not supplied (e.g., is set to NULL in the C case), then the x indices of *a* are mapped to the range *xmin* through *xmax* and the y indices of *a* are mapped to the range *ymin* through *ymax*.For the C case, transformation functions are provided in the PLplot library: **pltr0**(3plplot) for the identity mapping, and **pltr1**(3plplot) and **pltr2**(3plplot) for arbitrary mappings respectively defined by vectors and matrices.  In addition, C callback routines for the transformation can be supplied by the user such as the mypltr function in examples/c/x09c.c which provides a general linear transformation between index coordinates and world coordinates.For languages other than C you should consult the PLplot documentation for the details concerning how **PLTRANSFORM\_callback**(3plplot) arguments are interfaced. However, in general, a particular pattern of callback-associated arguments such as a tr vector with 6 elements; xg and yg vectors; or xg and yg matrices are respectively interfaced to a linear-transformation routine similar to the above mypltr function; **pltr1**(3plplot); and **pltr2**(3plplot). Furthermore, some of our more sophisticated bindings (see, e.g., the PLplot documentation) support native language callbacks for handling index to world-coordinate transformations.  Examples of these various approaches are given in examples/\<language\>x09\*, examples/\<language\>x16\*, examples/\<language\>x20\*, examples/\<language\>x21\*, and examples/\<language\>x22\*, for all our supported languages.

- *pltr\_data* (**PLPointer**(3plplot), input)

  Extra parameter to help pass information to **pltr0**(3plplot), **pltr1**(3plplot), **pltr2**(3plplot), or whatever routine that is externally supplied.

## AUTHORS

Many developers (who are credited at http://plplot.org/credits.php) have contributed to PLplot over its long history.

## SEE ALSO

PLplot documentation at http://plplot.org/documentation.php.
