myoverse.datatypes.KinematicsData.plot#
- KinematicsData.plot(representation, nr_of_fingers, wrist_included=True)[source]#
Plots the data.
- Parameters:
representation (str) – The representation to plot. .. important :: The representation should be a 3D tensor with shape (n_joints, 3, n_samples).
nr_of_fingers (int) – The number of fingers to plot.
wrist_included (bool, optional) – Whether the wrist is included in the representation. The default is True. .. note :: The wrist is always the first joint in the representation.
- Raises:
KeyError – If the representation does not exist.
Examples
>>> import numpy as np >>> from myoverse.datatypes import KinematicsData >>> >>> # Create sample kinematics data for a hand with 5 fingers >>> # 16 joints: 1 wrist + 3 joints for each of the 5 fingers >>> joint_data = np.random.randn(16, 3, 100) >>> kinematics = KinematicsData(joint_data, 100) >>> >>> # Plot the kinematics data >>> kinematics.plot('Input', nr_of_fingers=5) >>> >>> # Plot without wrist >>> kinematics.plot('Input', nr_of_fingers=5, wrist_included=False)