style_axes(ax[i], 'Humerothoracic Elevation (Deg)' if i == 2 else None, 'Axial Orientation (Deg)') ax[i].xaxis.set_major_locator(ticker.MultipleLocator(base=20.0)) act_row = {'ca': 0, 'sa': 1, 'fe': 2} for idx, (activity, activity_df) in enumerate( db_elev.groupby('Activity', observed=True)): cur_row = act_row[activity.lower()] _, agg_lines, quat_mean_lines = \ summary_plotter(activity_df['traj_interp'], 'ht', 'ht_ea_up', 'up', 'common_ht_range_coarse', 'common_coarse_up', 'euler.ht_isb', 2, ax[cur_row], ind_plotter, 'black', 'red', error_bars='std', alpha=0.5) # remove the quaternion average line quat_mean_lines[0].remove() del quat_mean_lines[0] make_interactive() plt.tight_layout(pad=0.5, h_pad=1.5, w_pad=0.5) fig.suptitle("HT yx'y'' Axial Orientation", fontsize=12, fontweight='bold', y=0.99) plt.subplots_adjust(top=0.93) fig.legend([agg_lines[0]], ['Mean'], ncol=1, handlelength=1.00, handletextpad=0.25, columnspacing=0.5, loc='upper right', bbox_to_anchor=(1, 1)) # add axes titles
params.scap_lateral, params.dtheta_fine, params.dtheta_coarse, [params.min_elev, params.max_elev], should_clean=False) (db['up_min_ht'], db['up_max_ht'], db['down_min_ht'], db['down_max_ht']) = zip( *(db['up_down_analysis'].apply(extract_up_down_min_max))) plot_utils.init_graphing(params.backend) plot_dirs = [['ht', 'ht_isb', 'HT'], ['gh', 'gh_isb', 'GH'], ['st', 'st_isb', 'ST']] for plot_dir in plot_dirs: traj = db.loc['U35_002_SA_t01', plot_dir[0]] traj_euler = getattr(traj, 'euler') fig = plt.figure(figsize=(14, 7), tight_layout=True) ax = fig.subplots(2, 3) for i in range(3): ax[0, i].plot(np.rad2deg(getattr(traj_euler, plot_dir[1])[:, i])) ax[1, i].plot(traj.pos[:, i]) if i == 0: plot_utils.style_axes(ax[0, i], None, 'Orientation (deg)') plot_utils.style_axes(ax[1, i], 'Frame Index (Zero-Based)', 'Position (mm)') else: plot_utils.style_axes(ax[0, i], None, None) plot_utils.style_axes(ax[1, i], 'Frame Index (Zero-Based)', None) fig.suptitle(plot_dir[2]) plot_utils.make_interactive() plt.show()