Home > Blockchain >  change the factorplot of seaborn to include dots
change the factorplot of seaborn to include dots

Time:01-24

I have a pandas dataframe that looks like this:

      feat  roi       sbj         alpha test_type       acc
0     cnn2  LOC  Subject1  normal_space   imagery  0.260961
1     cnn2  LOC  Subject1           0.4   imagery  0.755594
2     cnn4  LOC  Subject1  normal_space   imagery  0.282238
3     cnn4  LOC  Subject1           0.4   imagery  0.726485
4     cnn6  LOC  Subject1  normal_space   imagery  0.087359
5     cnn6  LOC  Subject1           0.4   imagery  0.701167
6     cnn8  LOC  Subject1  normal_space   imagery  0.209444
7     cnn8  LOC  Subject1           0.4   imagery  0.612597
8    glove  LOC  Subject1  normal_space   imagery  0.263176
9    glove  LOC  Subject1           0.4   imagery  0.659182
10    cnn2  FFA  Subject1  normal_space   imagery  0.276830
11    cnn2  FFA  Subject1           0.4   imagery  0.761014
12    cnn4  FFA  Subject1  normal_space   imagery  0.288127
13    cnn4  FFA  Subject1           0.4   imagery  0.727325
14    cnn6  FFA  Subject1  normal_space   imagery  0.113507
15    cnn6  FFA  Subject1           0.4   imagery  0.732963
16    cnn8  FFA  Subject1  normal_space   imagery  0.264455
17    cnn8  FFA  Subject1           0.4   imagery  0.615467
18   glove  FFA  Subject1  normal_space   imagery  0.245950
19   glove  FFA  Subject1           0.4   imagery  0.640502
20    cnn2  PPA  Subject1  normal_space   imagery  0.344078
...

For plotting it, I wrote:

ax = sns.factorplot(x="feat", y="acc", col="roi", hue="alpha", alpha = 0.9, data=df_s_pt, kind="bar").set(title = "perception, scene wise correlation")

The result look like this:

enter image description here

I want to upgrade it so it can look like the one in this answer (so it has the dots of each subject (i.e., Subject1, Subject2, ...))

Also, I want to control the color.

I could'nt use the code in that combining facetgrid of barplot with stripplot

  • Related