2016-08-17 71 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)