shade(self, data, cmap, norm=None, blend_mode='overlay', vmin=None, vmax=None, vert_exag=1, dx=1, dy=1, fraction=1, **kwargs)
The height values used to generate a shaded map.
The colormap used to color the data array. Note that this must be a ~matplotlib.colors.Colormap
instance. For example, rather than passing in cmap='gist_earth'
, use cmap=plt.get_cmap('gist_earth')
instead.
The normalization used to scale values before colormapping. If None, the input will be linearly scaled between its min and max.
The type of blending used to combine the colormapped data values with the illumination intensity. Default is "overlay". Note that for most topographic surfaces, "overlay" or "soft" appear more visually realistic. If a user-defined function is supplied, it is expected to combine an MxNx3 RGB array of floats (ranging 0 to 1) with an MxNx1 hillshade array (also 0 to 1). (Call signature func(rgb, illum, **kwargs)
) Additional kwargs supplied to this function will be passed on to the blend_mode function.
The minimum value used in colormapping data. If None the minimum value in data is used. If norm is specified, then this argument will be ignored.
The maximum value used in colormapping data. If None the maximum value in data is used. If norm is specified, then this argument will be ignored.
The amount to exaggerate the elevation values by when calculating illumination. This can be used either to correct for differences in units between the x-y coordinate system and the elevation coordinate system (e.g. decimal degrees vs. meters) or to exaggerate or de-emphasize topography.
The x-spacing (columns) of the input elevation grid.
The y-spacing (rows) of the input elevation grid.
Increases or decreases the contrast of the hillshade. Values greater than one will cause intermediate values to move closer to full illumination or shadow (and clipping any values that move beyond 0 or 1). Note that this is not visually or mathematically the same as vertical exaggeration.
An MxNx4 array of floats ranging between 0-1.
Combine colormapped data values with an illumination intensity map (a.k.a. "hillshade") of the values.
The following pages refer to to this document either explicitly or contain code examples using this.
matplotlib.colors.LightSource.__init__
matplotlib.colors.LightSource
Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.
Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)
SVG is more flexible but power hungry; and does not scale well to 50 + nodes.
All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them