plot_map

Maps.plot_map(layer=None, dynamic=False, set_extent=True, memmap=False, assume_sorted=True, **kwargs)

Actually generate the map-plot based on the data provided as m.data and the specifications defined in “data_specs” and “classify_specs”.

Note

Each call to plot_map will replace the collection used for picking! (only the last collection remains interactive on multiple calls to m.plot_map())

If you need multiple responsive datasets, use a new layer for each dataset! (e.g. via m2 = m.new_layer())

Parameters
  • layer (str or None) –

    The layer at which the dataset will be plotted. ONLY relevant if dynamic = False!

    • If “all”: the corresponding feature will be added to ALL layers

    • If None, the layer assigned to the Maps object is used (e.g. m.layer)

    The default is None.

  • dynamic (bool) – If True, the collection will be dynamically updated.

  • set_extent (bool) –

    Set the plot-extent to the data-extent.

    • if True: The plot-extent will be set to the extent of the data-coordinates

    • if False: The plot-extent is kept as-is

    The default is True

  • memmap (bool, str or pathlib.Path) –

    Use memory-mapping to save some memory by storing intermediate datasets (e.g. projected coordinates, indexes & the data) in a temporary folder on disc rather than keeping everything in memory. This causes a slight performance penalty when identifying clicked points but it can provide a reduction in memory-usage for very large datasets (or for a very large number of interactive layers).

    • If None: memory-mapping is only used if “shade_raster” or “shade_points” is used as plot-shape.

    • if False: memory-mapping is disabled

    • if True: memory-mapping is used with an automatically located tempfolder

    • if str or pathlib.Path: memory-mapping is used and the provided folder is used as location for the temporary files (stored in a temp-subfolder).

    NOTE: The tempfolder and all files will be deleted if the figure is closed, the Maps-object is deleted or the kernel is interrupted!

    The location of the tempfolder is accessible via m._tempfolder

    The default is False.

  • assume_sorted (bool, optional) –

    ONLY relevant for the shapes “raster” and “shade_raster” (and only if coordinates are provided as 1D arrays and data is a 2D array)

    Sort values with respect to the coordinates prior to plotting (required for QuadMesh if unsorted coordinates are provided)

    The default is True.

  • vmin (float, optional) – Min- and max. values assigned to the colorbar. The default is None.

  • vmax (float, optional) – Min- and max. values assigned to the colorbar. The default is None.

  • zorder (float) – The zorder of the artist (e.g. the stacking level of overlapping artists) The default is 1

  • kwargs

    kwargs passed to the initialization of the matpltolib collection (dependent on the plot-shape) [linewidth, edgecolor, facecolor, …]

    For “shade_points” or “shade_raster” shapes, kwargs are passed to datashader.mpl_ext.dsshow