Method shade
| Improve this Doc View Sourceshade(Double[,], DefinedFunc, Double, Double, Double, Double, Double, Double, Int32, Double, Double, Int32, Double, Int32, Double, Boolean, TransformFunc)
plshade: Shade individual region on the basis of value
Declaration
public static void shade(Double[, ] a, DefinedFunc defined, Double xmin, Double xmax, Double ymin, Double ymax, Double shade_min, Double shade_max, Int32 sh_cmap, Double sh_color, Double sh_width, Int32 min_color, Double min_width, Int32 max_color, Double max_width, Boolean rectangular, TransformFunc pltr)
Parameters
Type | Name | Description |
---|---|---|
Double[,] | a | A matrix containing function values to plot. Should have dimensions of nx by ny. |
DefinedFunc | defined | 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. |
Double | xmin | |
Double | xmax | |
Double | ymin | |
Double | ymax | |
Double | shade_min | Defines the lower end of the interval to be shaded. If shade_max leq shade_min, plshade does nothing. |
Double | shade_max | Defines the upper end of the interval to be shaded. If shade_max leq shade_min, plshade does nothing. |
Int32 | sh_cmap | 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). |
Double | sh_color | Defines color map index with integer value if cmap0 or value in range (0.0-1.0) if cmap1. |
Double | sh_width | Defines width used by the fill pattern. |
Int32 | min_color | 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. |
Double | min_width | 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. |
Int32 | max_color | 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. |
Double | max_width | 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. |
Boolean | rectangular | 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. |
TransformFunc | pltr | 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 for the identity mapping, and pltr1 and pltr2 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 for the details concerning how PLTRANSFORM_callback 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; and pltr2. Furthermore, some of our more sophisticated bindings (see, e.g., ) support native language callbacks for handling index to world-coordinate transformations. Examples of these various approaches are given in examples/ltlanguagegtx09*, examples/ltlanguagegtx16*, examples/ltlanguagegtx20*, examples/ltlanguagegtx21*, and examples/ltlanguagegtx22*, for all our supported languages. |
Remarks
Shade individual region on the basis of value. Use plshades if you want to shade a number of contiguous regions using continuous colors. In particular the edge contours are treated properly in plshades. If you attempt to do contiguous regions with plshade the contours at the edge of the shade are partially obliterated by subsequent plots of contiguous shaded regions.