rofunc.utils.visualab.trajectory#

1.  Module Contents#

1.1.  Functions#

traj_plot2d

Plot multiple 2d trajectories

traj_plot3d

Plot multiple 3d trajectories

traj_plot

Plot 2d or 3d trajectories

1.2.  API#

rofunc.utils.visualab.trajectory.traj_plot2d(data_lst: List, legend: str = None, title: str = None, g_ax=None)[source]#

Plot multiple 2d trajectories

Example:

>>> import rofunc as rf
>>> import numpy as np
>>> data_lst = [np.array([[0, 0], [1, 1], [2, 3]]),
...             np.array([[0, 0], [1, 2], [4, 2]])]
>>> fig = rf.visualab.traj_plot2d(data_lst, legend='test')
>>> plt.show()
Parameters:
  • data_lst

  • legend

  • title

  • g_ax

Returns:

rofunc.utils.visualab.trajectory.traj_plot3d(data_lst: List, legend: str = None, title: str = None, g_ax=None, ori: bool = False)[source]#

Plot multiple 3d trajectories

Example:

>>> import rofunc as rf
>>> import numpy as np
>>> data_lst = [np.array([[0, 0, 0], [1, 1, 1], [2, 2, 2]]),
...             np.array([[1, 0, 0], [1, 4, 6], [2, 4, 3]])]
>>> fig = rf.visualab.traj_plot3d(data_lst, legend='test')
>>> plt.show()
Parameters:
  • data_lst – the list of trajectories

  • legend – the legend of the figure

  • title – the title of the figure

  • g_ax – whether to plot on a global axis

  • ori – plot orientation or not

Returns:

the figure

rofunc.utils.visualab.trajectory.traj_plot(data_lst: List, legend: str = None, title: str = None, mode: str = None, ori: bool = False, g_ax=None)[source]#

Plot 2d or 3d trajectories

Example:

>>> import rofunc as rf
>>> import numpy as np
>>> data_lst = [np.array([[0, 0], [1, 1], [2, 3]]),
...             np.array([[0, 0], [1, 2], [4, 2]])]
>>> fig = rf.visualab.traj_plot(data_lst, legend='test')
>>> plt.show()

>>> data_lst = [np.array([[0, 0, 0], [1, 1, 1], [2, 2, 2]]),
...             np.array([[1, 0, 0], [1, 4, 6], [2, 4, 3]])]
>>> fig = rf.visualab.traj_plot(data_lst, legend='test')
>>> plt.show()
Parameters:
  • data_lst – list with 2d array or 3d array

  • legend – legend of the figure

  • title – title of the figure

  • mode – ‘2d’ or ‘3d’

  • ori – plot orientation or not

  • g_ax – global axis

Returns: