geetools.FeatureCollection.FeatureCollectionAccessor.plot_by_features#

geetools.FeatureCollection.FeatureCollectionAccessor.plot_by_features(type='bar', featureId='system:index', properties=[], labels=[], colors=[], ax=None, **kwargs)#

Plot the values of a ee.FeatureCollection by feature.

Each feature property selected in properties will be plotted using the featureId as the x-axis. If no properties are provided, all properties will be plotted. If no featureId is provided, the “system:index” property will be used.

Parameters:
  • type (str) – The type of plot to use. Defaults to “bar”. can be any type of plot from the python lib matplotlib.pyplot. If the one you need is missing open an issue!

  • featureId (str) – The property to use as the x-axis (name the features). Defaults to “system:index”.

  • properties (list) – A list of properties to plot. Defaults to all properties.

  • labels (list) – A list of labels to use for plotting the properties. If not provided, the default labels will be used. It needs to match the properties length.

  • colors (list) – A list of colors to use for plotting the properties. If not provided, the default colors from the matplotlib library will be used.

  • ax (Optional[matplotlib.axes.Axes]) – The matplotlib axes to use. If not provided, the plot will be send to a new figure.

  • kwargs – Additional arguments from the pyplot function.

Return type:

matplotlib.axes.Axes

Examples

import ee, geetools

fc = ee.FeatureCollection("FAO/GAUL/2015/level2").limit(10)
fc.geetools.plot_by_features(properties=["ADM1_CODE", "ADM2_CODE"])

Note

This function is a client-side function.