Skip to content

matplotlib extension functions to plot trajectories

License

Notifications You must be signed in to change notification settings

Yuricst/trajplotlib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

trajplotlib

matplotlib extension functions to plot trajectories

Documentation Status

Dependencies: Python>=3.7, Matplotlib, numpy

3D trajectory with equal size axes

To generate a quick 3D trajectory plot with equal-axis is a one-liner:

import matplotlib.pyplot as plt
import trajplotlib

# compute/load data for xs, ys, zs

# create plot
fig, ax = trajplotlib.quickplot3(xs, ys, zs, radius=184.0)
plt.show()

In the above, xs, ys, and zs are arrays of the trajectory coordinates, and radius is an optional value for plotting a sphere of radius radius.

This generates the following:

The above function returns ax, which is an Axes3DSubplot object. As such, the plot may be modified or more elements may be appended just as one would do with regular matplotlib:

ax.set_xlabel('x, km')
ax.set_ylabel('y, km')
ax.set_zlabel('z, km')
ax.set_title("My trajectory")

About

matplotlib extension functions to plot trajectories

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages