小编Ilk*_*sik的帖子

相互叠加显示 2 个 Seaborn 图

我想创建一个图,在其中可视化单个数据点以及不同变量的一些集中趋势度量。我想我可以在同一轴上使用seaborn stripplot(带有一些抖动)和pointplot。

import seaborn as sns
tips = sns.load_dataset("tips")
sns.set(style="white", color_codes=True)
ax = sns.stripplot(x="sex", y="total_bill", hue='smoker', data=tips,
                   split=True, jitter=True)
ax = sns.pointplot(x="sex", y="total_bill", hue='smoker', data=tips,
                   dodge=True, join=False)
Run Code Online (Sandbox Code Playgroud)

但是,当我执行此操作时,带状图中的数据值和点图中的误差线会倾斜并且不会显示在彼此之上: 示例图

如何解决此问题,以便误差线显示在抖动数据值的顶部?

python plot seaborn

6
推荐指数
1
解决办法
6911
查看次数

如何在 sns clustermap 中标记集群

我正在使用以下代码创建聚类图。

import numpy as np
import pandas as pd
import seaborn as sns

all_net_names  = ['early_vis', 'face', 'motion', 'scene', 'scene', 'scene', 
                  'dmn', 'dmn', 'dmn', 'dmn', 'dmn', 'dmn', 'reward', 'reward',
                  'reward', 'reward', 'reward', 'ofc', 'ofc', 'ofc', 'ofc']

roi_names = ['E', 'F', 'M', 'S1', 'S2', 'S3', 'D1', 'D2', 'D3', 'D4', 'D5',
             'D6', 'R1', 'R2', 'R3', 'R4', 'R5','O1', 'O2', 'O3', 'O4']

n_roi = len(roi_names)
M = np.random.rand(n_roi, n_roi) # array to plot

net_ind = sorted(np.unique(all_net_names, return_index=True)[1])
net_names = [all_net_names[index] for index in sorted(net_ind)] …
Run Code Online (Sandbox Code Playgroud)

python cluster-computing seaborn

3
推荐指数
1
解决办法
1875
查看次数

使用bash查找并替换json文件中的值

我有几个.json与此类似的文件。

{
    "AcquisitionNumber": 1,
    "TotalReadoutTime": 0.035,
    "IntendedFor": "func/sub-02_task-rest_run-01_bold.nii.gz"
}
Run Code Online (Sandbox Code Playgroud)

我想使用 bash 变量更改“IntendedFor”行中的 sub 编号,循环遍历不同的 subs。例如,如果 sub 是 03:

sub=03
echo $sub
03
Run Code Online (Sandbox Code Playgroud)

如何使用此 bash 变量更改sub-02to的值sub-03

bash json

0
推荐指数
1
解决办法
3869
查看次数

标签 统计

python ×2

seaborn ×2

bash ×1

cluster-computing ×1

json ×1

plot ×1