shade_raster๏ƒ

set_shape.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.