[英]How to add values/ labels over each marker in lineplot in Python Seaborn?
[英]python: seaborn lineplot customize marker size based on values of a column
我有如下数据:
#df
df = pd.DataFrame({
'id': {0: -3, 1: 2, 2: -3, 3: 1},
'val': {0: 0.4, 1: 0.03, 2: 0.88, 3: 1.3},
'indicator': {0: 'A', 1: 'A', 2: 'B', 3: 'B'},
'count': {0: 40000, 1: 5779, 2: 3000, 3: 31090}
})
df
如果我执行以下代码,我将拥有:
sns.relplot(x = 'id', y = 'val', hue = 'indicator', size = 'count', data = df)
我想要一条连接点的线。 但是,如果我将 plot 更改为 plot 行,我将有任何图表。
sns.lineplot(x = 'id', y = 'val', hue = 'indicator', size = 'count', data = df)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.