uavfpy.planner.plots

Module Contents

Functions

plot_surface_3d(ax: mpl_toolkits.mplot3d.axes3d.Axes3D, X, Y, Hground, Hsheet, zsquash=0.5, sheetcmap='gist_earth', groundcmap='bone', sheet_alpha=0.4, wireframe=False, wirecount=20)

Put surfaces from Hground (the "ground") and Hsheet (the "sheet") onto an ax. ax must

plot_surface_2d(ax, X, Y, Hsheet, cmap='coolwarm', levels=20)

Plot contours of a 3-D surface in 2-d.

uavfpy.planner.plots.plot_surface_3d(ax: mpl_toolkits.mplot3d.axes3d.Axes3D, X, Y, Hground, Hsheet, zsquash=0.5, sheetcmap='gist_earth', groundcmap='bone', sheet_alpha=0.4, wireframe=False, wirecount=20)

Put surfaces from Hground (the “ground”) and Hsheet (the “sheet”) onto an ax. ax must be a 3d axis.

Parameters
axAxes3D

the axis on which to place the surfaces.

Xnp.ndarray

MxN x coordinate information of the grid

Ynp.ndarray

MxN y coordinate information of the grid

Hgroundnp.ndarray

MxN “ground” height.

Hsheetnp.ndarray

MxN “sheet” height

zsquashfloat, optional

by default, the 3d projection will render a cube. But this can make obstacles appear very tall. So we can squish the grid a bit to make it more like a 3d map and less like a cube., by default 0.5

sheetcmapstr, optional

colormap of the sheet, by default “ocean”

groundcmapstr, optional

colormap of the ground, by default “copper”

sheet_alphafloat, optional

alpha of the sheet. 1.0 is completely opaque, 0.0 is not visible, by default 0.4

wireframebool, optional

whether to draw wireframe or surface

Returns
Axes3D

ax containing the new plots the ax object passed in is altered in place, so you don’t necessarily need to do anything with this (just calling the function on ax is enough to alter the object)

uavfpy.planner.plots.plot_surface_2d(ax, X, Y, Hsheet, cmap='coolwarm', levels=20)

Plot contours of a 3-D surface in 2-d.

Parameters
axplt.Axes

The axis on which to draw the plot. Must be 2D.

Xnp.ndarray

MxN array of grid X-points.

Ynp.ndarray

MxN array of grid Y-points.

Hsheetnp.ndarray

MxN array of grid Z-points.

cmapstr, optional

name of matplotlib colormap. See: https://matplotlib.org/stable/tutorials/colors/colormaps.html, by default “coolwarm”

levelsint, optional

Number of contour levels, by default 20

Returns
plt.Axes

The plot axes object. Note: plot axes are altered in place by this function, so you don’t need to assign it.