### Author Topic: Figure 3. Scatter plots of the rigid-body components—shear, stretch, and opening  (Read 3598 times)

#### shuxiang

• with-posts
• Posts: 56
##### Figure 3. Scatter plots of the rigid-body components—shear, stretch, and opening
« on: June 10, 2019, 01:07:21 pm »
Figure 3. Scatter plots of the rigid-body components—shear, stretch, and opening—that distinguish the modes of G·A association in RNA-containing structures. Smooth curves on the edges of the scatter plots are the normalized densities of individual parameters. Points with the magnitude of opening in excess of 180° include requisite changes in the signs of shear, stretch, buckle, and propeller. Color-coding of dominant pairs matches that in Figures 1 and 2. Secondary states with 16 or more structural examples are noted by related hues. Images depict the spread of values in the shear–opening (left) and shear–stretch (right) planes for antiparallel G–A (top) and parallel G+A (bottom) arrangements.

#### shuxiang

• with-posts
• Posts: 56
##### Re: Figure 3. Scatter plots of the rigid-body components—shear, stretch, and opening
« Reply #1 on: June 10, 2019, 01:24:06 pm »
Install Jupyter Notebook on the computer

import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
import scipy.stats as sci
GA_All_df.dssr = GA_All_df.dssr.str[1:]
def correction_plus(x):
x['opening'] += 360
x['shear'] *= -1
x['stretch'] *= -1
x['buckle'] *= -1
x['propeller'] *= -1
return x
def correction_minus(x):
x['opening'] -= 360
x['shear'] *= -1
x['stretch'] *= -1
x['buckle'] *= -1
x['propeller'] *= -1
return x
GA_All_df.update(GA_All_df.loc[(GA_All_df.opening < -60)&(GA_All_df.dssr=='m-m')].apply(correction_plus,  axis=1))
GA_All_df.update(GA_All_df.loc[(GA_All_df.opening > 120)&(GA_All_df.dssr=='M-M')].apply(correction_minus, axis=1))
GA_All_df.update(GA_All_df.loc[(GA_All_df.opening > 60)&(GA_All_df.dssr=='m+m')].apply(correction_minus, axis=1))
GA_All_df.update(GA_All_df.loc[(GA_All_df.opening > 60)&(GA_All_df.dssr=='.+W')].apply(correction_minus, axis=1))
GA_All_df.update(GA_All_df.loc[(GA_All_df.opening > 60)  & (GA_All_df.dssr=='.+M')].apply(correction_minus, axis=1))
GA_All_df.update(GA_All_df.loc[(GA_All_df.opening<-60)&(GA_All_df.dssr=='M+M')].apply(correction_plus,axis=1))
GA_m_plus_m = GA_All_df.loc[GA_All_df.dssr=='m+m']
GA_All_df.loc[(GA_All_df.stretch<0)&(GA_All_df.dssr=='m-m')]
GA_dot_plus_M = GA_All_df.loc[GA_All_df.dssr=='.+M']
GA_dot_plus_M.shape
GA_dot_plus_M_mean = GA_dot_plus_M.mean()
GA_dot_plus_M_mean
GA_dot_plus_M_std = GA_dot_plus_M.std()
GA_dot_plus_M_std
GA_dot_plus_M_other = GA_dot_plus_M.loc[(GA_dot_plus_M.stretch-GA_dot_plus_M_mean.stretch).abs()>2*GA_dot_plus_M_std.stretch]
GA_dot_plus_M_other
GA_plus= GA_All_df[GA_All_df['dssr'].str.contains("\\+")]
GA_WpW = GA_plus[GA_plus['dssr'].str.contains('W\\+W')]
GA_dotpW = GA_plus[GA_plus['dssr'].str.contains('\.\\+W')]
GA_dotpM = GA_plus[GA_plus['dssr'].str.contains('\.\\+M')]
GA_MpM = GA_plus[GA_plus['dssr'].str.contains('M\\+M')]
GA_WpM = GA_plus[GA_plus['dssr'].str.contains('W\\+M')]
GA_mpM = GA_plus[GA_plus['dssr'].str.contains('m\\+M')]
GA_mpW = GA_plus[GA_plus['dssr'].str.contains('m\\+W')]
GA_mpm = GA_plus[GA_plus['dssr'].str.contains('m\\+m')]
GA_mpdot = GA_plus[GA_plus['dssr'].str.contains('m\\+\.')]
GA_MpW = GA_plus[GA_plus['dssr'].str.contains('M\\+W')]
GA_Wpm = GA_plus[GA_plus['dssr'].str.contains('W\\+m')]
GA_Mpm = GA_plus[GA_plus['dssr'].str.contains('M\\+m')]
GA_dotpm = GA_plus[GA_plus['dssr'].str.contains('\.\\+m')]
GA_Wpdot = GA_plus[GA_plus['dssr'].str.contains('W\\+\.')]
temp = GA_dot_plus_M_other.loc[((GA_dot_plus_M_other.stretch-GA_WpM.mean().stretch).abs()<2*GA_WpM.std().stretch)&((GA_dot_plus_M_other.shear-GA_WpM.mean().shear).abs()<2*GA_WpM.std().shear)]
GA_All_df.loc[temp.index,'dssr']='W+M'
temp
temp = GA_dot_plus_M_other.loc[((GA_dot_plus_M_other.stretch-GA_mpM.mean().stretch).abs()<2*GA_mpM.std().stretch)&((GA_dot_plus_M_other.shear-GA_mpM.mean().shear).abs()<2*GA_mpM.std().shear)]
GA_All_df.loc[temp.index,'dssr']='m+M'
temp
temp = GA_dot_plus_M_other.loc[((GA_dot_plus_M_other.stretch-GA_mpW.mean().stretch).abs()<2*GA_mpW.std().stretch)&((GA_dot_plus_M_other.shear-GA_mpW.mean().shear).abs()<2*GA_mpW.std().shear)]
GA_All_df.loc[temp.index,'dssr']='m+W'
temp
temp = GA_dot_plus_M_other.loc[((GA_dot_plus_M_other.stretch-GA_dotpW.mean().stretch).abs()<2*GA_dotpW.std().stretch)&((GA_dot_plus_M_other.shear-GA_dotpW.mean().shear).abs()<2*GA_dotpW.std().shear)]
GA_All_df.loc[temp.index,'dssr']='.+W'
temp
temp = GA_dot_plus_M_other.loc[((GA_dot_plus_M_other.stretch-GA_mpdot.mean().stretch).abs()<2*GA_mpdot.std().stretch)&((GA_dot_plus_M_other.shear-GA_mpdot.mean().shear).abs()<2*GA_mpdot.std().shear)]
GA_All_df.loc[temp.index,'dssr']='m+.'
temp
temp = GA_dot_plus_M_other.loc[((GA_dot_plus_M_other.stretch-GA_mpm.mean().stretch).abs()<2*GA_mpm.std().stretch)&((GA_dot_plus_M_other.shear-GA_mpm.mean().shear).abs()<2*GA_mpm.std().shear)]
GA_All_df.loc[temp.index,'dssr']='m+m'
temp
GA_dot_plus_W = GA_All_df.loc[GA_All_df.dssr=='.+W']
GA_dot_plus_W.shape
GA_dot_plus_W_mean = GA_dot_plus_W.mean()
GA_dot_plus_W_mean
GA_dot_plus_W_std = GA_dot_plus_W.std()
GA_dot_plus_W_std
GA_dot_plus_W_other = GA_dot_plus_W.loc[(GA_dot_plus_W.stretch-GA_dot_plus_W_mean.stretch).abs()>2*GA_dot_plus_W_std.stretch]
GA_dot_plus_W_other
temp = GA_dot_plus_W_other.loc[((GA_dot_plus_W_other.stretch-GA_WpM.mean().stretch).abs()<2*GA_WpM.std().stretch)&((GA_dot_plus_W_other.shear-GA_WpM.mean().shear).abs()<2*GA_WpM.std().shear)]
GA_All_df.loc[temp.index,'dssr']='W+M'
temp
temp = GA_dot_plus_W_other.loc[((GA_dot_plus_W_other.stretch-GA_mpM.mean().stretch).abs()<2*GA_mpM.std().stretch)&((GA_dot_plus_W_other.shear-GA_mpM.mean().shear).abs()<2*GA_mpM.std().shear)]
GA_All_df.loc[temp.index,'dssr']='m+M'
temp
temp = GA_dot_plus_W_other.loc[((GA_dot_plus_W_other.stretch-GA_mpW.mean().stretch).abs()<2*GA_mpW.std().stretch)&((GA_dot_plus_W_other.shear-GA_mpW.mean().shear).abs()<2*GA_mpW.std().shear)]
GA_All_df.loc[temp.index,'dssr']='m+W'
temp
temp = GA_dot_plus_W_other.loc[((GA_dot_plus_W_other.stretch-GA_dotpM.mean().stretch).abs()<2*GA_dotpM.std().stretch)&((GA_dot_plus_M_other.shear-GA_dotpM.mean().shear).abs()<2*GA_dotpM.std().shear)]
GA_All_df.loc[temp.index,'dssr']='.+M'
temp
temp = GA_dot_plus_W_other.loc[((GA_dot_plus_W_other.stretch-GA_mpdot.mean().stretch).abs()<2*GA_mpdot.std().stretch)&((GA_dot_plus_W_other.shear-GA_mpdot.mean().shear).abs()<2*GA_mpdot.std().shear)]
GA_All_df.loc[temp.index,'dssr']='m+.'
temp
temp = GA_dot_plus_W_other.loc[((GA_dot_plus_W_other.stretch-GA_mpm.mean().stretch).abs()<2*GA_mpm.std().stretch)&((GA_dot_plus_W_other.shear-GA_mpm.mean().shear).abs()<2*GA_mpm.std().shear)]
GA_All_df.loc[temp.index,'dssr']='m+m'
temp
GA_All_df.loc[(GA_All_df.stretch>0)&(GA_All_df.dssr=='.+W')]
GA_m_W=GA_All_df[GA_All_df['dssr'].str.contains("m-W")]
GA_m_W['shear'].hist(bins=20)
GA_minus= GA_All_df[GA_All_df['dssr'].str.contains("-")]
GA_minus['dssr'].value_counts()
GA_m_m = GA_minus[GA_minus['dssr'].str.contains('m-m')]
GA_m_W = GA_minus[GA_minus['dssr'].str.contains('m-W')]
GA_m_W_1=GA_m_W.loc[GA_m_W['shear'] <5]
GA_m_W_2=GA_m_W.loc[GA_m_W['shear'] >=5]
GA_m_M = GA_minus[GA_minus['dssr'].str.contains('m-M')]
GA_m_M_1=GA_m_M.loc[GA_m_M['opening'] >=-30]
GA_m_M_2=GA_m_M.loc[GA_m_M['opening'] <-30]
GA_M_M = GA_minus[GA_minus['dssr'].str.contains('M-M')]
GA_M_W = GA_minus[GA_minus['dssr'].str.contains('M-W')]
GA_W_m = GA_minus[GA_minus['dssr'].str.contains('W-m')]
GA_W_M = GA_minus[GA_minus['dssr'].str.contains('W-M')]
GA_W_W = GA_minus[GA_minus['dssr'].str.contains('W-W')]
GA_dot_W =GA_minus[GA_minus['dssr'].str.contains('\.-W')]
GA_dot_M =GA_minus[GA_minus['dssr'].str.contains('\.-M')]
GA_M_dot = GA_minus[GA_minus['dssr'].str.contains('M-\.')]
GA_M_m = GA_minus[GA_minus['dssr'].str.contains('M-m')]
GA_W_dot = GA_minus[GA_minus['dssr'].str.contains('W-\.')]
GA_W_W.shape
GA_plus= GA_All_df[GA_All_df['dssr'].str.contains("\\+")]
GA_plus['dssr'].value_counts()
GA_WpW = GA_plus[GA_plus['dssr'].str.contains('W\\+W')]
GA_dotpW = GA_plus[GA_plus['dssr'].str.contains('\.\\+W')]
GA_dotpM = GA_plus[GA_plus['dssr'].str.contains('\.\\+M')]
GA_MpM = GA_plus[GA_plus['dssr'].str.contains('M\\+M')]
GA_WpM = GA_plus[GA_plus['dssr'].str.contains('W\\+M')]
GA_mpM = GA_plus[GA_plus['dssr'].str.contains('m\\+M')]
GA_mpW = GA_plus[GA_plus['dssr'].str.contains('m\\+W')]
GA_mpW_1=GA_mpW.loc[GA_mpW['stretch'] >=-6]
GA_mpW_2=GA_mpW.loc[GA_mpW['stretch'] <-6]
GA_mpm = GA_plus[GA_plus['dssr'].str.contains('m\\+m')]
GA_mpdot = GA_plus[GA_plus['dssr'].str.contains('m\\+\.')]
GA_MpW = GA_plus[GA_plus['dssr'].str.contains('M\\+W')]
GA_Wpm = GA_plus[GA_plus['dssr'].str.contains('W\\+m')]
GA_Mpm = GA_plus[GA_plus['dssr'].str.contains('M\\+m')]
GA_dotpm = GA_plus[GA_plus['dssr'].str.contains('\.\\+m')]
GA_Wpdot = GA_plus[GA_plus['dssr'].str.contains('W\\+\.')]
GA_m_m['opening'].shape
g=sns.jointplot(x = 'opening',y = 'shear', data = GA_All_df, space = 0.1, ratio = 3, height=8)
g.ax_joint.cla()
g.ax_marg_x.cla()
g.ax_marg_y.cla()
for xlabel_i in g.ax_marg_x.get_xticklabels():
xlabel_i.set_visible(False)
for ylabel_i in g.ax_marg_y.get_yticklabels():
ylabel_i.set_visible(False)
x_labels = g.ax_joint.get_xticklabels()
g.ax_joint.set_xlim(-210,210)
g.ax_joint.xaxis.set_ticks([-180,-120,-60,0,60,120,180])
g.ax_joint.set_ylim(-9,10)
g.ax_joint.yaxis.set_ticks([-9,-6,-3,0,3,6,9])
g.ax_joint.scatter(x = GA_m_m['opening'],    y = GA_m_m['shear'],  data = GA_m_m,  c= '#FF3333', edgecolors= '#080808',linewidth='0.5', s=100)
g.ax_joint.scatter(x = GA_m_W['opening'],    y = GA_m_W['shear'],  data = GA_m_W,  c= '#FF33FF', edgecolors= '#080808',linewidth='0.5', s=100)
g.ax_joint.scatter(x = GA_m_M['opening'],    y = GA_m_M['shear'],  data = GA_m_M,  c= '#3333FF', edgecolors= '#080808',linewidth='0.5', s=100)
g.ax_joint.scatter(x = GA_W_M['opening'],    y = GA_W_M['shear'],  data = GA_W_M,  c= '#66FFFF', edgecolors= '#080808',linewidth='0.5', s=100)
g.ax_joint.scatter(x = GA_M_M['opening'],    y = GA_M_M['shear'],  data = GA_M_M,  c= '#66FF66', edgecolors= '#080808',linewidth='0.5', s=100)
g.ax_joint.scatter(x = GA_M_W['opening'],    y = GA_M_W['shear'],  data = GA_M_W,  c= '#FFFF00', edgecolors= '#080808',linewidth='0.5', s=100)
g.ax_joint.scatter(x = GA_W_m['opening'],    y = GA_W_m['shear'],  data = GA_W_m,  c= '#FFB2AC', edgecolors= '#080808',linewidth='0.5', s=100)
g.ax_joint.scatter(x = GA_W_W['opening'],    y = GA_W_W['shear'],  data = GA_W_W,  c= '#A0A0A0', edgecolors= '#080808',linewidth='0.5', s=100)
labels = ['m-m','m-W','m-M','W-M','M-M','M-W','W-m','W-W']
g.ax_joint.legend(labels,bbox_to_anchor=(1.67, 1.0), facecolor='white', edgecolor='white')
ch = chr(197)
g.ax_joint.set_ylabel('Shear (' + ch +')')
g.ax_joint.set_xlabel('Opening (deg)')
ax1 =g.ax_marg_x
ax2 = g.ax_marg_y
ax1.yaxis.set_ticklabels(("0","","0.5"), visible = True)
ax2.xaxis.set_ticks([0,0.55,1.1])
ax2.xaxis.set_ticklabels(("0","","0.5"), visible = True)
sns.kdeplot(data = GA_m_m['opening'],  ax = ax1,  color = '#FF3333',legend = False)
sns.kdeplot(data = GA_m_W['opening'],  ax = ax1,  color = '#FF33FF',legend = False)
sns.kdeplot(data = GA_m_M['opening'],  ax = ax1,  color = '#3333FF',legend = False)
sns.kdeplot(data = GA_W_M['opening'],  ax = ax1,  color = '#66FFFF',legend = False)
sns.kdeplot(data = GA_M_M['opening'],  ax = ax1,  color = '#66FF66',legend = False)
sns.kdeplot(data = GA_M_W['opening'],  ax = ax1,  color = '#FFFF00',legend = False)
sns.kdeplot(data = GA_W_m['opening'],  ax = ax1,  color = '#FFB2AC',legend = False)
sns.kdeplot(data = GA_W_W['opening'],  ax = ax1,  color = '#A0A0A0',legend = False)
sns.kdeplot(data = GA_m_m['shear'],  ax = ax2,  color = '#FF3333',legend = False,vertical = True)
sns.kdeplot(data = GA_m_W['shear'],  ax = ax2,  color = '#FF33FF',legend = False,vertical = True)
sns.kdeplot(data = GA_m_M['shear'],  ax = ax2,  color = '#3333FF',legend = False,vertical = True)
sns.kdeplot(data = GA_W_M['shear'],  ax = ax2,  color = '#66FFFF',legend = False,vertical = True)
sns.kdeplot(data = GA_M_M['shear'],  ax = ax2,  color = '#66FF66',legend = False,vertical = True)
sns.kdeplot(data = GA_M_W['shear'],  ax = ax2,  color = '#FFFF00',legend = False,vertical = True)
sns.kdeplot(data = GA_W_m['shear'],  ax = ax2,  color = '#FFB2AC',legend = False,vertical = True)
sns.kdeplot(data = GA_W_W['shear'],  ax = ax2,  color = '#A0A0A0',legend = False,vertical = True)
g=sns.jointplot(x = 'stretch',y = 'shear', data = GA_All_df, space = 0.1, ratio = 3, height=8)
g.ax_joint.cla()
g.ax_marg_x.cla()
g.ax_marg_y.cla()
for xlabel_i in g.ax_marg_x.get_xticklabels():
xlabel_i.set_visible(False)
for ylabel_i in g.ax_marg_y.get_yticklabels():
ylabel_i.set_visible(False)
x_labels = g.ax_joint.get_xticklabels()
y_labels = g.ax_joint.get_yticklabels()
g.ax_joint.set_xlim(-9,10)
g.ax_joint.xaxis.set_ticks([-9,-6,-3,0,3,6,9])
g.ax_joint.set_ylim(-9,10)
g.ax_joint.yaxis.set_ticks([-9,-6,-3,0,3,6,9])
g.ax_joint.scatter(x = GA_m_m['stretch'],  y = GA_m_m['shear'],  data = GA_m_m,  c= '#FF3333', edgecolors= '#080808',linewidth='0.5', s=100)
g.ax_joint.scatter(x = GA_m_W['stretch'],  y = GA_m_W['shear'],  data = GA_m_W,  c= '#FF33FF', edgecolors= '#080808',linewidth='0.5', s=100)
g.ax_joint.scatter(x = GA_m_M['stretch'],  y = GA_m_M['shear'],  data = GA_m_M,  c= '#3333FF', edgecolors= '#080808',linewidth='0.5', s=100)
g.ax_joint.scatter(x = GA_W_M['stretch'],  y = GA_W_M['shear'],  data = GA_W_M,  c= '#66FFFF', edgecolors= '#080808',linewidth='0.5', s=100)
g.ax_joint.scatter(x = GA_M_M['stretch'],  y = GA_M_M['shear'],  data = GA_M_M,  c= '#66FF66', edgecolors= '#080808',linewidth='0.5', s=100)
g.ax_joint.scatter(x = GA_M_W['stretch'],  y = GA_M_W['shear'],  data = GA_M_W,  c= '#FFFF00', edgecolors= '#080808',linewidth='0.5', s=100)
g.ax_joint.scatter(x = GA_W_m['stretch'],  y = GA_W_m['shear'],  data = GA_W_m,  c= '#FFB2AC', edgecolors= '#080808',linewidth='0.5', s=100)
g.ax_joint.scatter(x = GA_W_W['stretch'],  y = GA_W_W['shear'],  data = GA_W_W,  c= '#A0A0A0', edgecolors= '#080808',linewidth='0.5', s=100)
labels = ['m-m','m-W','m-M','W-M','M-M','M-W','W-m','W-W']
g.ax_joint.legend(labels,bbox_to_anchor=(1.67, 1.0), facecolor='white', edgecolor='white')
ch = chr(197)
g.ax_joint.set_ylabel('Shear (' + ch +')')
g.ax_joint.set_xlabel('Stretch (' + ch +')')
ax1 =g.ax_marg_x
ax2 = g.ax_marg_y
ax1.yaxis.set_ticks([0,0.75,1.5])
ax1.yaxis.set_ticklabels(("0","","0.5"), visible = True)
ax2.xaxis.set_ticks([0,0.55,1.1])
ax2.xaxis.set_ticklabels(("0","","0.5"), visible = True)
sns.kdeplot(data = GA_m_m['stretch'],  ax = ax1,  color = '#FF3333',legend = False)
sns.kdeplot(data = GA_m_W['stretch'],  ax = ax1,  color = '#FF33FF',legend = False)
sns.kdeplot(data = GA_m_M['stretch'],  ax = ax1,  color = '#3333FF',legend = False)
sns.kdeplot(data = GA_W_M['stretch'],  ax = ax1,  color = '#66FFFF',legend = False)
sns.kdeplot(data = GA_M_M['stretch'],  ax = ax1,  color = '#66FF66',legend = False)
sns.kdeplot(data = GA_M_W['stretch'],  ax = ax1,  color = '#FFFF00',legend = False)
sns.kdeplot(data = GA_W_m['stretch'],  ax = ax1,  color = '#FFB2AC',legend = False)
sns.kdeplot(data = GA_W_W['stretch'],  ax = ax1,  color = '#A0A0A0',legend = False)
sns.kdeplot(data = GA_m_m['shear'],  ax = ax2,  color = '#FF3333',legend = False,vertical = True)
sns.kdeplot(data = GA_m_W['shear'],  ax = ax2,  color = '#FF33FF',legend = False,vertical = True)
sns.kdeplot(data = GA_m_M['shear'],  ax = ax2,  color = '#3333FF',legend = False,vertical = True)
sns.kdeplot(data = GA_W_M['shear'],  ax = ax2,  color = '#66FFFF',legend = False,vertical = True)
sns.kdeplot(data = GA_M_M['shear'],  ax = ax2,  color = '#66FF66',legend = False,vertical = True)
sns.kdeplot(data = GA_M_W['shear'],  ax = ax2,  color = '#FFFF00',legend = False,vertical = True)
sns.kdeplot(data = GA_W_m['shear'],  ax = ax2,  color = '#FFB2AC',legend = False,vertical = True)
sns.kdeplot(data = GA_W_W['shear'],  ax = ax2,  color = '#A0A0A0',legend = False,vertical = True)
g=sns.jointplot(x = 'opening',y = 'shear', data = GA_All_df, space = 0.1,ratio = 3, height=8)
g.ax_joint.cla()
g.ax_marg_x.cla()
g.ax_marg_y.cla()
for xlabel_i in g.ax_marg_x.get_xticklabels():
xlabel_i.set_visible(False)
for ylabel_i in g.ax_marg_y.get_yticklabels():
ylabel_i.set_visible(False)
x_labels = g.ax_joint.get_xticklabels()
g.ax_joint.set_xlim(-210,210)
g.ax_joint.xaxis.set_ticks([-180,-120,-60,0,60,120,180])
g.ax_joint.set_ylim(-9,10)
g.ax_joint.yaxis.set_ticks([-9,-6,-3,0,3,6,9])
g.ax_joint.scatter(x = GA_WpM['opening'],  y = GA_WpM['shear'],  data = GA_WpM,  c= '#C0C0C0',edgecolors= '#080808',linewidth='0.5', s=100)
g.ax_joint.scatter(x = GA_dotpM['opening'],y = GA_dotpM['shear'],data = GA_dotpM,c= '#FF3333',edgecolors= '#080808',linewidth='0.5', s=100)
g.ax_joint.scatter(x = GA_mpM['opening'],  y = GA_mpM['shear'],  data = GA_mpM,  c= '#99FF33',edgecolors= '#080808',linewidth='0.5', s=100)
g.ax_joint.scatter(x = GA_mpW['opening'],  y = GA_mpW['shear'],  data = GA_mpW,  c= '#3399FF',edgecolors= '#080808',linewidth='0.5', s=100)
g.ax_joint.scatter(x = GA_dotpW['opening'],y = GA_dotpW['shear'],data = GA_dotpW,c= '#66FFFF',edgecolors= '#080808',linewidth='0.5', s=100)
g.ax_joint.scatter(x = GA_mpm['opening'],  y = GA_mpm['shear'],  data = GA_mpm,  c= '#FF3399',edgecolors= '#080808',linewidth='0.5', s=100)
g.ax_joint.scatter(x = GA_mpdot['opening'],y = GA_mpdot['shear'],data = GA_mpdot,c ='#9933FF',edgecolors= '#080808',linewidth='0.5', s=100)
g.ax_joint.scatter(x=GA_MpM['opening'],y=GA_MpM['shear'],data=GA_MpM,c='#FF9933',edgecolors='#080808',linewidth='0.5',s=100)
g.ax_joint.scatter(x=GA_MpW['opening'],y=GA_MpW['shear'],data=GA_MpW,c='#FFFF66',edgecolors='#080808',linewidth='0.5',s=100)
labels = ['W+M','.+M','m+M','m+W','.+W','m+.','m+m','M+M','M+W']
leg = g.ax_joint.legend(labels,bbox_to_anchor=(1.67, 1.0), facecolor='white', edgecolor='white')
leg.legendHandles[5].set_color('#9933FF')
leg.legendHandles[6].set_color('#FF3399')
ch = chr(197)
g.ax_joint.set_ylabel('Shear (' + ch +')')
g.ax_joint.set_xlabel('Opening (deg)')
ax1 =g.ax_marg_x
ax2 = g.ax_marg_y
ax1.yaxis.set_ticks([0,0.03,0.06])
ax1.yaxis.set_ticklabels(("0","","0.5"), visible = True)
ax2.xaxis.set_ticks([0,0.6,1.2])
ax2.xaxis.set_ticklabels(("0","","0.5"), visible = True)
sns.kdeplot(GA_WpM['opening'],  ax = ax1,legend = False, color = '#C0C0C0')
sns.kdeplot(GA_dotpM['opening'],ax = ax1,legend = False, color = '#FF3333')
sns.kdeplot(GA_mpM['opening'],  ax = ax1,legend = False, color = '#99FF33')
sns.kdeplot(GA_mpW['opening'],  ax = ax1,legend = False, color = '#3399FF')
sns.kdeplot(GA_dotpW['opening'],ax = ax1,legend = False, color = '#66FFFF')
sns.kdeplot(GA_mpdot['opening'],ax = ax1,legend = False, color = '#FF3399',bw=2)
sns.kdeplot(GA_mpm['opening'],  ax = ax1,legend = False, color = '#9933FF')
sns.kdeplot(GA_MpM['opening'],ax=ax1,legend=False,color='#FF9933')
sns.kdeplot(GA_MpW['opening'],ax=ax1,legend=False,color='#FFFF66')
sns.kdeplot(GA_WpM['shear'],  ax = ax2,legend = False, color = '#C0C0C0',vertical = True)
sns.kdeplot(GA_dotpM['shear'],ax = ax2,legend = False, color = '#FF3333',vertical = True)
sns.kdeplot(GA_mpM['shear'],  ax = ax2,legend = False, color = '#99FF33',vertical = True)
sns.kdeplot(GA_mpW['shear'],  ax = ax2,legend = False, color = '#3399FF',vertical = True)
sns.kdeplot(GA_dotpW['shear'],ax = ax2,legend = False, color = '#66FFFF',vertical = True)
sns.kdeplot(GA_mpdot['shear'],ax = ax2,legend = False, color = '#FF3399',vertical = True,bw=2)
sns.kdeplot(GA_mpm['shear'],  ax = ax2,legend = False, color = '#9933FF',vertical = True)
sns.kdeplot(GA_MpM['shear'],ax=ax2,legend=False,color='#FF9933',vertical=True)
sns.kdeplot(GA_MpW['shear'],ax=ax2,legend=False,color='#FFFF66',vertical=True)
GA_MpM['opening']
GA_MpM['shear']
g=sns.jointplot(x = 'stretch',y = 'shear', data = GA_All_df, space = 0.1,ratio = 3, height=8)
g.ax_joint.cla()
g.ax_marg_x.cla()
g.ax_marg_y.cla()
for xlabel_i in g.ax_marg_x.get_xticklabels():
xlabel_i.set_visible(False)
for ylabel_i in g.ax_marg_y.get_yticklabels():
ylabel_i.set_visible(False)
x_labels = g.ax_joint.get_xticklabels()
y_labels = g.ax_joint.get_yticklabels()
g.ax_joint.set_xlim(-9,10)
g.ax_joint.xaxis.set_ticks([-9,-6,-3,0,3,6,9])
g.ax_joint.set_ylim(-9,10)
g.ax_joint.yaxis.set_ticks([-9,-6,-3,0,3,6,9])
g.ax_joint.scatter(x = GA_WpM['stretch'],  y = GA_WpM['shear'],  data = GA_WpM,  c= '#C0C0C0',edgecolors= '#080808',linewidth='0.5', s=100)
g.ax_joint.scatter(x = GA_dotpM['stretch'],y = GA_dotpM['shear'],data = GA_dotpM,c= '#FF3333',edgecolors= '#080808',linewidth='0.5', s=100)
g.ax_joint.scatter(x = GA_mpM['stretch'],  y = GA_mpM['shear'],  data = GA_mpM,  c= '#99FF33',edgecolors= '#080808',linewidth='0.5', s=100)
g.ax_joint.scatter(x = GA_mpW['stretch'],  y = GA_mpW['shear'],  data = GA_mpW,  c= '#3399FF',edgecolors= '#080808',linewidth='0.5', s=100)
g.ax_joint.scatter(x = GA_dotpW['stretch'],y = GA_dotpW['shear'],data = GA_dotpW,c= '#66FFFF',edgecolors= '#080808',linewidth='0.5', s=100)
g.ax_joint.scatter(x = GA_mpm['stretch'],  y = GA_mpm['shear'],  data = GA_mpm,  c= '#FF3399',edgecolors= '#080808',linewidth='0.5', s=100)
g.ax_joint.scatter(x = GA_mpdot['stretch'],y = GA_mpdot['shear'],data = GA_mpdot,c ='#9933FF',edgecolors= '#080808',linewidth='0.5', s=100)
g.ax_joint.scatter(x=GA_MpM['stretch'],y=GA_MpM['shear'],data=GA_MpM,c='#FF9933',edgecolors='#080808',linewidth='0.5',s=100)
g.ax_joint.scatter(x=GA_MpW['stretch'],y=GA_MpW['shear'],data=GA_MpW,c='#FFFF66',edgecolors='#080808',linewidth='0.5',s=100)
labels = ['W+M','.+M','m+M','m+W','.+W','m+.','m+m','M+M','M+W']
leg = g.ax_joint.legend(labels,bbox_to_anchor=(1.67, 1.0), facecolor='white', edgecolor='white')
leg.legendHandles[5].set_color('#9933FF')
leg.legendHandles[6].set_color('#FF3399')
ch = chr(197)
g.ax_joint.set_ylabel('Shear (' + ch +')')
g.ax_joint.set_xlabel('Stretch (' + ch +')')
ax1 =g.ax_marg_x
ax2 = g.ax_marg_y
ax1.yaxis.set_ticks([0,0.57,1.14])
ax1.yaxis.set_ticklabels(("0","","0.5"), visible = True)
ax2.xaxis.set_ticks([0,0.6,1.2])
ax2.xaxis.set_ticklabels(("0","","0.5"), visible = True)
sns.kdeplot(GA_WpM['stretch'],  ax = ax1,legend = False, color = '#C0C0C0')
sns.kdeplot(GA_dotpM['stretch'],ax = ax1,legend = False, color = '#FF3333')
sns.kdeplot(GA_mpM['stretch'],  ax = ax1,legend = False, color = '#99FF33')
sns.kdeplot(GA_mpW['stretch'],  ax = ax1,legend = False, color = '#3399FF')
sns.kdeplot(GA_dotpW['stretch'],ax = ax1,legend = False, color = '#66FFFF')
sns.kdeplot(GA_mpdot['stretch'],ax = ax1,legend = False, color = '#FF3399',bw=2)
sns.kdeplot(GA_mpm['stretch'],  ax = ax1,legend = False, color = '#9933FF')
sns.kdeplot(GA_MpM['stretch'],ax=ax1,legend=False,color='#FF9933')
sns.kdeplot(GA_MpW['stretch'],ax=ax1,legend=False,color='#FFFF66')
sns.kdeplot(GA_WpM['shear'],  ax = ax2,legend = False, color = '#C0C0C0',vertical = True)
sns.kdeplot(GA_dotpM['shear'],ax = ax2,legend = False, color = '#FF3333',vertical = True)
sns.kdeplot(GA_mpM['shear'],  ax = ax2,legend = False, color = '#99FF33',vertical = True)
sns.kdeplot(GA_mpW['shear'],  ax = ax2,legend = False, color = '#3399FF',vertical = True)
sns.kdeplot(GA_dotpW['shear'],ax = ax2,legend = False, color = '#66FFFF',vertical = True)
sns.kdeplot(GA_mpdot['shear'],ax = ax2,legend = False, color = '#FF3399',vertical = True,bw=2)
sns.kdeplot(GA_mpm['shear'],  ax = ax2,legend = False, color = '#9933FF',vertical = True)
sns.kdeplot(GA_MpM['shear'],ax=ax2,legend=False,color='#FF9933',vertical=True)
sns.kdeplot(GA_MpW['shear'],ax=ax2,legend=False,color='#FFFF66',vertical=True)