2016-08-17 139 views
0

2个seaborn图形对象我有两个matplotlib(seaborn)图对象都在不同的IPython细胞制造。呈现相同IPython的细胞

#One Cell 
fig_1_object = sns.factorplot(y='freq',x='d_fam',col='easy_donor',kind="bar",data=collection_d_fam) 
fig_1 = fig_1_object.fig 


#Two Cell 
fig_2_object = sns.factorplot(y='freq',x='d_fam',col='easy_donor',kind="bar",data=collection_c_fam) 
fig_2 = fig_2_object.fig 

我该如何在同一个单元格中“显示”它们。我打开了matplotlib内联。

#third cell 
fig_1 
fig_2 
>>Only shows fig_2 

回答

2

你只需要从IPython.display模块导入display功能:

from IPython.display import display 
import seaborn 

%matplotlib inline 

g1 = seaborn.factorplot(**options1) 
g2 = seaborn.factorplot(**options2) 

display(g1) 
display(g2)