pybob.plot_tools

pybob.plot_tools.plot_chips_corr_matrix(srcimg, destimg, corrmat)[source]
Parameters:
  • srcimg
  • destimg
  • corrmat
Returns:

pybob.plot_tools.plot_ddem_results(img, colormap='seismic', caxsize='2.5%', clim=None, sfact=None)[source]
Parameters:
  • img
  • colormap
  • caxsize
  • clim
  • sfact
Returns:

pybob.plot_tools.plot_dh_elevation(dDEM, DEM, glacier_mask=None, binning=None, bin_width=50, polyorder=None)[source]
Parameters:
  • dDEM
  • DEM
  • glacier_mask
  • binning
  • bin_width
  • polyorder
Returns:

pybob.plot_tools.plot_geoimg_sidebyside(img1, img2, com_extent=None, fig=None, cmap='gray', output_directory='.', filename=None)[source]
Parameters:
  • img1
  • img2
  • com_extent
  • fig
  • cmap
  • output_directory
  • filename
Returns:

pybob.plot_tools.plot_nice_histogram(data_values, outfilename, output_directory)[source]
Parameters:
  • data_values
  • outfilename
  • output_directory
Returns:

pybob.plot_tools.plot_polygon_df(polygon_df, fig=None, ax=None, mpl='mpl_polygon', **kwargs)[source]

Plot a GeoDataFrame of polygons to figure.

Parameters:
  • polygon_df (geopandas.GeoDataFrame) – GeoDataFrame of polygon(s) to plot.
  • fig (matplotlib.pyplot.Figure) – Optional existing figure to plot polygons to. If unset, creates a new figure.
  • ax (matplotlib.axes) – Optional axis handle to plot polygons to. If unset, uses fig.gca()
  • mpl (str) – GeoDataFrame column name containing multipolygon indices. Default is mpl_polygon.
  • kwargs – Keyword options to pass to matplotlib.collections.PatchCollection.
Returns fig, polygon_df:
 

Figure handle of the plot created, and updated geodataframe with plot geometries.

Examples:

>>> rgi = gpd.read_file('07_rgi60_Svalbard.shp')
>>> f, rgi = plot_polygon_df(rgi, color='w', edgecolor='k', lw=.2, alpha=0.5)
pybob.plot_tools.plot_shaded_dem(dem, azimuth=315, altitude=45, fig=None, extent=None, alpha=0.35, colormap='terrain', **kwargs)[source]

Plot a shaded relief image of a DEM.

Parameters:
  • dem (pybob.GeoImg) – GeoImg representing a DEM.
  • azimuth (float) – Solar azimuth angle, in degress from North. Default 315.
  • altitude (float) – Solar altitude angle, in degrees from horizon. Default 45.
  • fig (matplotlib.figure.Figure) – Figure to show image in. If not set, creates a new figure.
  • extent (array-like) – Spatial extent to limit the figure to, given as xmin, xmax, ymin, ymax.
  • alpha (float) – Alpha value to set DEM to. Default is 0.35.
  • colormap (str) – colormap style for matplotlib
  • kwargs – Optional keyword arguments to pass to plt.imshow
Returns fig:

Handle pointing to the matplotlib Figure created (or passed to display).

pybob.plot_tools.save_results_quicklook(img, raster, com_ext, outfilename, vmin=0, vmax=10, sfact=2, output_directory='.')[source]
Parameters:
  • img
  • raster
  • com_ext
  • outfilename
  • vmin
  • vmax
  • sfact
  • output_directory
Returns:

pybob.plot_tools.set_pretty_fonts(font_size=24, legend_size=16)[source]

sets matplotlib fonts to be nice and pretty for graphs that don’t completely suck.

pybob.plot_tools.truncate_colormap(cmap, minval=0, maxval=1, n=100)[source]
Parameters:
  • cmap
  • minval
  • maxval
  • n
Returns: