trajOptLib.plot package¶
Submodules¶
trajOptLib.plot.compare module¶
compare.py
Extensively used when I want to compare several samples
-
trajOptLib.plot.compare.
compare
(arr, x=None, ax=None, transpose=False, show=False, **kwargs)[source]¶ Given a matrix or 3d tensor, do some comparison
arr is 3d tensor or list of 2d array x is the x-coordinate for each Cat, so it is a list of 1d nparray trnspose = True make the data be data by sample show = False means not plot immediately TODO: headtail = True means distinguish between 1st and last samples kwargs are allowed configurations, we have to pass in dict
trajOptLib.plot.plot3d module¶
plot3d.py
-
trajOptLib.plot.plot3d.
addSphere
(ax, xc, yc, zc, r, elev=10, color='g', alpha=0.2, **kwargs)[source]¶
-
trajOptLib.plot.plot3d.
plot
(x, y=None, z=None, ax=None, axis=1, noz=False, show=False, scatter=False, **kwargs)[source]¶ Easy-2-use function for plotting, either line or scatter is supported, 2d and 3d are supported Refer scatter for document
-
trajOptLib.plot.plot3d.
scatter
(x, y=None, z=None, ax=None, axis=1, noz=False, show=False, **kwargs)[source]¶ plot scatter figure. if y and z is None, simply use M, col determines 2d (default) or 3d axis determines column-wise (default) or row-wise plot if y is not None, and M and y are both 1d, plot 2d, otherwise do it for 1st axis if z is not None, do the same for 3d case kwargs might be xaxis, xind, yaxis, yind, zaxis, zind
-
trajOptLib.plot.plot3d.
set_axes_equal
(ax)[source]¶ Make axes of 3D plot have equal scale so that spheres appear as spheres, cubes as cubes, etc.. This is one possible solution to Matplotlib’s ax.set_aspect(‘equal’) and ax.axis(‘equal’) not working for 3D.
- Input
- ax: a matplotlib axis, e.g., as output from plt.gca().