coincident.plot.boxplot_terrain_diff#

coincident.plot.boxplot_terrain_diff(dem_list, ax=None, terrain_v='slope', terrain_groups=None, ylims=None, title='Elevation Differences (m) by Terrain', ylabel='Elevation Difference (m)', elev_col=None)#

Box plots of elevation differences by terrain group for two input elevation datasets. (e.g. elevation differences over varying slopes for two DEMs) This also shows the counts of the grouped elevation differences

Parameters:
  • dem_list (list[xr.Dataset | gpd.GeoDataFrame]) – List containing exactly two elevation datasets to compare. The first dataset must be a xr.Dataset with an ‘elevation’ variable and a variable corresponding to the terrain_v variable (e.g. ‘slope’).

  • terrain_v (str) – Terrain variable of interest (e.g. ‘slope’) that exists in first DEM. This is what your elevation differences will be grouped by

  • terrain_groups (np.ndarray) – Array defining the edges of terrain groups. e.g. if set to np.arange(0, 46, 1), the groups will be [0, 1, 2, …, 45]

  • ylims (list) – The y-axis limits for the plot. If None, then the y-axis limits will be automatically adjusted to fit the whiskers of each boxplot

  • title (str) – The title of the plot. Default is ‘Elevation Differences (m) by Terrain’

  • ylabel (str) – The yabel of the plot. Default is ‘Elevation Difference (m)’

  • elev_col (str) – The name of the column containing elevation values to difference in the GeoDataFrame if a GeoDataFrame is provided

Returns:

The matplotlib axes object containing the plot.

Return type:

plt.Axes

Notes

This function assumes that the datasets in dem_list are in the same CRS and aligned This function can also work with point geometry GeoDataFrames (e.g. ICESat-2 points) If using a GeoDataFrame, you must also provide the elev_col parameter which is the column name containing elevation values you wish to compare This function requires there to be EXACTLY 2 datasets in the dem_list. The first dataset in dem_list MUST be a xr.Dataset with an ‘elevation’ variable and the corresponding terrain_v variable (e.g. ‘slope’)

Parameters:

ax (Axes | None)