This repository was archived by the owner on Aug 1, 2022. It is now read-only.
Description There is a crash when trying to plot annotations for a barplot in statannot-0.2.3 and seaborn-0.10.0.
Consider the following code:
import numpy as np
import pandas as pd
import statannot
import seaborn as sns
import matplotlib .pyplot as plt
np .random .seed (42 )
df = pd .DataFrame ({
'y' : np .random .random (size = 50 ),
'x' : np .random .choice (['X1' , 'X2' ], size = 50 ),
})
ax = sns .barplot (x = 'x' , y = 'y' , data = df )
statannot .add_stat_annotation (
ax , plot = 'barplot' ,
data = df , x = 'x' , y = 'y' ,
box_pairs = [('X1' , 'X2' )],
test = 'Mann-Whitney' , text_format = 'simple'
)
plt .show ()
It crashes with the error
Traceback (most recent call last ):
File "test.py" , line 21 , in < module >
test = 'Mann-Whitney' , text_format = 'simple'
File "../python/site-packages/statannot/statannot.py" , line 442 , in add_stat_annotation
errcolor = ".26" , errwidth = None , capsize = None , dodge = True )
TypeError : __init__ () missing 1 required positional argument : 'seed'
This bug can be fixed by adding e.g. seed=None, in
box_plotter = sns .categorical ._BarPlotter (
x , y , hue , data , order , hue_order ,
estimator = np .mean , ci = 95 , n_boot = 1000 , units = None ,
orient = None , color = None , palette = None , saturation = .75 ,
errcolor = ".26" , errwidth = None , capsize = None , dodge = True )
.
Reactions are currently unavailable