shade_rasterο
- shapes.shade_raster(aggregator='mean', shade_hook=None, agg_hook=None)ο
Shade the data as a rectangular raster (>> usable for very large datasets!).
- Using a raster-based shading is only possible if:
the data can be converted to rectangular 2D arrays
This function is based on the functionalities of datashader.mpl_ext.dsshow provided by the matplotlib-extension for datashader.
Note
The shade_raster-shape uses a QuadMesh to represent the datapoints.
As a requirement for correct identification of the pixels, the data must be sorted by coordinates! (see assume_sorted argument of m.plot_map() for more details.)
- Parameters
aggregator (str or datashader.reductions, optional) β
The reduction to compute per-pixel. (see https://datashader.org/api.html#reductions for details)
If a string is provided, it is interpreted as ds.<aggregator>(βvalβ) where βvalβ represents the data-values.
Possible string values are: - βmeanβ, βminβ, βmaxβ, βfirstβ, βlastβ, βstdβ, βsumβ, βvarβ, βcountβ
The default is βmeanβ, e.g. datashader.mean(βvalβ)
shade_hook (callable, optional) β A callable that takes the image output of the shading pipeline, and returns another Image object. See dynspread() and spread() for examples. The default is None.
agg_hook (callable, optional) β A callable that takes the computed aggregate as an argument, and returns another aggregate. This can be used to do preprocessing before the aggregate is converted to an image. The default is None.