In [1]:
%run '../ipython_startup.py'
In [2]:
from sas7bdat import SAS7BDAT as SAS
In [5]:
with SAS(os.path.join(PROJ, 'sas_data/clean_ase_sbs.sas7bdat')) as FH:
df = FH.to_data_frame()
In [32]:
fig, (ax1, ax2, ax3) = plt.subplots(1, 3, figsize=(8, 3), sharex=True, sharey=True)
xlab = r'q5 Mean $\theta$ Mated'
ylab = r'q5 Mean $\theta$ Virgin'
grp = df.groupby('line')
grp.get_group('r324').plot(kind='scatter', x='q5_mean_theta_m', y='q5_mean_theta_v', title='r324', ax=ax1, rot=90)
grp.get_group('r365').plot(kind='scatter', x='q5_mean_theta_m', y='q5_mean_theta_v', title='r365', ax=ax2, rot=90)
grp.get_group('w47').plot(kind='scatter', x='q5_mean_theta_m', y='q5_mean_theta_v', title='w47', ax=ax3, rot=90)
ax1.plot([0, 1], [0, 1], color='r', lw=2)
ax2.plot([0, 1], [0, 1], color='r', lw=2)
ax3.plot([0, 1], [0, 1], color='r', lw=2)
ax1.set_xlabel(xlab); ax1.set_ylabel(ylab)
ax2.set_xlabel(xlab); ax2.set_ylabel(ylab)
ax3.set_xlabel(xlab); ax3.set_ylabel(ylab)
plt.tight_layout()
fig.savefig(os.path.join(PROJ, 'pipeline_output/ase_summary/scatter_q5_mean_theta_mated_vs_virgin_selected.png'), dpi=300)
In [ ]: