Seaborn PairGrid:显示每个子图的轴刻度标签 [英] Seaborn PairGrid: show axes tick-labels for each subplot
本文介绍了Seaborn PairGrid:显示每个子图的轴刻度标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
使用seaborn.PairGrid
是否可以显示每个子图的轴刻度标签? (对于seaborn.FacetGrid
,相当于sharex=False, sharey=False
)
With seaborn.PairGrid
is there a way to show the axes tick-labels for each subplot? (an equivalent to sharex=False, sharey=False
in case of seaborn.FacetGrid
)
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
df = pd.DataFrame()
for n in ['a', 'b']:
tmp = pd.DataFrame({'name': [n] * 100,
'prior': [1, 10] * 50,
'post': [1, 10] * 50})
df = df.append(tmp)
g = sns.PairGrid(df, hue='name', diag_sharey=False)
g.map_offdiag(sns.regplot, fit_reg=False, x_jitter=.1)
g.map_diag(sns.distplot, kde=False)
推荐答案
在此处找到答案: _ = ...
的精确之处在于可以抑制交互式环境中不必要的打印输出.
Where it is precised that _ = ...
is here to suppress unwanted print out in interactive environments.
这篇关于Seaborn PairGrid:显示每个子图的轴刻度标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文