GithubHelp home page GithubHelp logo

trevismd / statannotations Goto Github PK

View Code? Open in Web Editor NEW
613.0 5.0 66.0 9.76 MB

add statistical significance annotations on seaborn plots. Further development of statannot, with bugfixes, new features, and a different API.

License: Other

Python 99.89% Shell 0.11%
statistics plotting seaborn annotations

statannotations's People

Contributors

agamemnonc avatar amkorb avatar dizak avatar efharkin avatar getzze avatar jasonmendoza2008 avatar josephlalli avatar louisonf avatar mbhall88 avatar mmagnus avatar mxposed avatar orena1 avatar sepro avatar stfnrpplngr avatar tathey1 avatar thewchan avatar trevismd avatar webermarcolivier avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

statannotations's Issues

Use different statistical tests in one process

Hey!
In my data processing, data in different pairs may have different distributions and I wanna use different statistical tests for different pairs, according to whether the data in a pair both conform to normal distribution or not.
So is there any way to solve this problem?

Annotations outside of axis with "loc=inside" set

While having the loc=inside option set, is it possible to show the annotations outside of the y-axis limit?
I tried to do that by changing the y limits after using statannotations, because else the axis limits are increased, causing the bars to shrink too much (see below).

Unfortunately, by changing the limits afterwards the brackets are not displayed anymore. Do you know what is causing that?
image

Chi Squared test between categorical data and asterisk change on the stars when exporting graphs into LaTeX

I posted this question/answer to statannot and have not had a chance to try it with statannotations. I'll see what I can do but below is the issue I had and the way to solve the problem. I wanted to add chi-squared tests. I'm new to trying to do a Pull Request and am assuming that the code would not work if I tried to make one. What would be the best route to go about doing so?

Here is the link to the previous closed issue:
webermarcolivier/statannot#65

Thanks!

Support to Seaborn v0.12

Hi there,

currently, statannotations cannot support seaborn v0.12. There are some more new functions in seaborn v0.12, but I cannot use it due to the compatibility issue, which is not convenient. therefore, can I request an update of statannotations to get compatible with seaborn v0.12. This would be wonderful.

Thanks for your contribution to such a good package~

BR

AttributeError: 'tuple' object has no attribute '__module__' when using plot_and_annotate_facets

Hi, after I defined the plot_and_annotate_facets function, there's one AttributeError: 'tuple' object has no attribute 'module' from g.map function. I found plot_and_annotate_facets is a tuple. Could you please tell me if I am using this function correctly or not? Thank you very much!

annot = Annotator(None, pairs)
plot_and_annotate_facets = annot.plot_and_annotate_facets(
    plot='boxplot', plot_params=plot_params, configuration=configuration, annotation_func='set_custom_annotations', annotation_params=annotation_params, **kwargs)
g = sns.FacetGrid(
    plot_df,
    col="Cell type"
)
g.map(
    plot_and_annotate_facets,
    feature_name, # x
    value_name, # y
)

Screenshot 2022-10-27 at 12 39 53

boxplot with hue: annot. not correctly lining up

In this graph, the annotations are supposed to go from pink (LN) to pink, but they only go from green (HN) to green and I can't figure out what's wrong. I've attached the image and the code I used for this particular graph below.

chrome_kclDjlW4mf

order = list(set(df['Genotype']))
order.sort()
pairs = [[('A3GK', 'LN'), ('COL', 'LN')], [('COL', 'LN'), ('GV5', 'LN')]]
hue_order = ['NN','HN','LN']

plot_params = {
    'data': df,
    'x': 'Genotype',
    'y': 'PR_Length',
    "order": order,
    "hue": 'Condition'}

plot = sns.boxplot(**plot_params,hue_order = hue_order)

annotator = Annotator(plot, pairs, **plot_params)
annotator.configure(test='Mann-Whitney', verbose=1)
annotator.apply_test()
annotator.annotate()
sns.move_legend(plot, "upper left", bbox_to_anchor=(1, 1))
plt.show()

Test against a fixed population mean

The rendering should be the same as the one you obtain when testing a column against itself (i.e. pairs=[('col1', 'col1')]), but testing against a fixed population mean.

I think this can be done neatly by reusing the pairs positional argument and introducing objects for representing the intended tests.

from statsannotations import Pair, Population

Annotator(ax, [Pair('col1', 'col2'), Population('col1', popmean=0, alternative='two-sided'), ('col2', 'col3')])

Remove ns p-value lines

Thank you for the nice package. can we add a method to remove the lines that are not significant?
so if the pvalue is less than 0.05, the package remove the whole line

Annotation position misalignment

Hi!
I first appreciate your efforts to make this amazing python library for plotting.
I tried to use this tool to make some plots with annotations, but I encountered an issue that I couldn't fix.
Annotations do not align for multiple annotations.
Here is the image.

image

I tried to adjust the ylim, but it doesn't work.

image

Below is my code.
`plt.figure(figsize=(15,8))
ax = sns.boxplot(x=x,y=y, hue=hue,data=df,fliersize=0,saturation=0.7)

plt.legend(bbox_to_anchor=(1.02, 1), loc='upper left', borderaxespad=0)
annotator = Annotator(ax, pairs_all,x=x,y=y, hue=hue, data=df,verbose=False)

annotator.configure(text_format="star",loc='inside', verbose=False)
annotator.set_pvalues(p_values_all)
annotator.annotate()
ax.set_ylim(-950, -550)
plt.show()`

I tried to use several different hyperparameters, such as line_offset_to_group. The only way to make it works is to put annotations outside.
image

I would very appreciate if anyone could guide me.
Thank you!

How to remove * (ns)?

I'm unclear what the label * (ns) means, is this point significant or not? The adjusted p-value is < 0.05 so I'm unclear why the (ns) is there. Would be great if there's a way to remove this. Thanks!

One-sided t-test

It would be great if one could set a dynamic tail for a one-sided t-test. I.e. instead of having a static value

annotator.apply_test(alternative='greater')

one could input an array determining which tail should be evaluated for which pair combination.

Stat layout is not align with x ticks for boxplot plotted with panda dataframe

Hi,
i'm using your very helpful package to annotate datasets that i store and plot using pandas data frame methods.
When adding stat annotation to data frame boxplot layout, the lines presents an offset on x.
To illustrate my problem i plotted the data first using the data frame method and then using seaborn library.

import seaborn as sns
from statannotations.Annotator` import Annotator

fig, axs = plt.subplots(1,2)

axs[0] = average_annual_adult_go.boxplot(ax=axs[0], grid=False)
annotator0 = Annotator(ax=axs[0], data=average_annual_adult_go, pairs=[("Initial state","Working phase")], order=["Initial state", "Working phase"])
annotator0.configure(test='t-test_welch', text_format='star', loc='outside')
annotator0.apply_and_annotate()

axs[1] = sns.boxplot(data=average_annual_adult_go)
annotator1 = Annotator(ax=axs[1], data=average_annual_adult_go, pairs=[("Initial state","Working phase")], order=["Initial state", "Working phase"])
annotator1.configure(test='t-test_welch', text_format='star', loc='outside')
annotator1.apply_and_annotate()

the result :

p-value annotation legend:
ns: p <= 1.00e+00
*: 1.00e-02 < p <= 5.00e-02
**: 1.00e-03 < p <= 1.00e-02
***: 1.00e-04 < p <= 1.00e-03
****: p <= 1.00e-04

Initial state vs. Working phase: Welch's t-test independent samples, P_val:5.684e-272 t=3.485e+02
p-value annotation legend:
ns: p <= 1.00e+00
*: 1.00e-02 < p <= 5.00e-02
**: 1.00e-03 < p <= 1.00e-02
***: 1.00e-04 < p <= 1.00e-03
****: p <= 1.00e-04

Initial state vs. Working phase: Welch's t-test independent samples, P_val:5.684e-272 t=3.485e+02

statannotations_openissues

Implementing New Tests

Hi, thanks for the great package. What is the best convention for implementing new tests? I wrote a new test in the StatTest file, copying the wilcoxon example, however a new Annotator couldn't find the test, and raised an exception here. I (think I) got it to work by adding my new entry in IMPLEMENTED_TESTS in the test file, but I was not sure if this is the intended usage, since I couldn't find documentation directing me to do so.

Happy to PR some documentation updates if you think it'd be useful.

Support to Seaborn v0.12

Hi there,

currently, statannotations cannot support seaborn v0.12. There are some more new functions in seaborn v0.12, but I cannot use it due to the compatibility issue, which is not convenient. therefore, can I request an update of statannotations to get compatible with seaborn v0.12. This would be wonderful.

Thanks for your contribution to such a good package~

BR

comparisons_correction annotation

I set ‘comparisons_correction=BH’, but the p-values report and annotate equal to the case ‘comparisons_correction=None’. Specifically, in the example notebook, section 'Multiple comparisons', for Mann-Whitney-Wilcoxon test two-sided with/without Benjamini-Hochberg correction, the reported and annotated p-values are equal.
Indeed, it seems, only comparisons_correction="Bonferroni" annotates and reports correctly.

Only displaying tests that are significant

The tests that are displayed are defined by what's fed into the argument pairs of Annotator but we don't know prior to running apply_and_annotate what tests are significant. I don't think there's an easy way to eliminate from the list fed to pairs the pairs that are not significant.

Limiting annotations shown

Hi @mxposed

I will like to find out if there was a documentation for this tool? I would like to know if there is an option to limit annotations to only statistically significant comparisons

Thank you

Support to Seaborn v0.12

Hi there,

currently, statannotations cannot support seaborn v0.12. There are some more new functions in seaborn v0.12, but I cannot use it due to the compatibility issue, which is not convenient. therefore, can I request an update of statannotations to get compatible with seaborn v0.12. This would be wonderful.

Thanks for your contribution on such a good package~

BR

Changing font size

Hi,

Everything is in the title: how can we change annotation fontsize when using set_custom_annotation ?

Create conda package

It would be great if this package were available on conda. The only hurdle to this I think is merging #56

Mixing up of pairs with pvalues; boxplot with hues

Hi,
When plotting a boxplot with hues, I have certain pairs and a list of pvalues, in which values are in the same order as pairs order. But, after plotting, the pairs are getting assigned with different pvalues, not following the assigned order. This problem only happens when I use set_custom_annotations but when using set_pvalues, the order of pairs and pvalues are okay. I am trying to understand why this is happening, does the pairs get sorted and then the pvalues are assigned to them? Any insights will be helpful.
Thanks

Annotator does not work if any of the groups has only NaN values

Hey @trevismd

Right now Annotator does not work if any of the groups have only NaN values. Is there a way to perform a test between the other groups and ignore the group that has only NaN values?

In order to make it work I added zero values to the group that has only NaN values. I made it look like this:
image

Otherwise I get the following error when I try yo run the Annotator:

>>> Annotator(ax, pairs, data=df[['CONTROL_Edited', 'CONTROL_Not_Edited', 'AD_Edited', 'AD_Not_Edited']], order=order)
/media/kokyriakidis/RED/BCBIO/anaconda/envs/postprocessSPRINT/lib/python3.8/site-packages/seaborn/categorical.py:82: FutureWarning: iteritems is deprecated and will be removed in a future version. Use .items instead.
  plot_data = [np.asarray(s, float) for k, s in iter_data]
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/media/kokyriakidis/RED/BCBIO/anaconda/envs/postprocessSPRINT/lib/python3.8/site-packages/statannotations/Annotator.py", line 106, in __init__
    self._plotter = self._get_plotter(engine, ax, pairs, plot, data,
  File "/media/kokyriakidis/RED/BCBIO/anaconda/envs/postprocessSPRINT/lib/python3.8/site-packages/statannotations/Annotator.py", line 778, in _get_plotter
    return engine_plotter(*args, **kwargs)
  File "/media/kokyriakidis/RED/BCBIO/anaconda/envs/postprocessSPRINT/lib/python3.8/site-packages/statannotations/_Plotter.py", line 94, in __init__
    self.value_maxes = self._generate_value_maxes()
  File "/media/kokyriakidis/RED/BCBIO/anaconda/envs/postprocessSPRINT/lib/python3.8/site-packages/statannotations/_Plotter.py", line 215, in _generate_value_maxes
    group_name, value_pos = self._get_value_pos(child, data_to_ax)
  File "/media/kokyriakidis/RED/BCBIO/anaconda/envs/postprocessSPRINT/lib/python3.8/site-packages/statannotations/_Plotter.py", line 316, in _get_value_pos
    return self._get_value_pos_for_path_collection(
  File "/media/kokyriakidis/RED/BCBIO/anaconda/envs/postprocessSPRINT/lib/python3.8/site-packages/statannotations/_Plotter.py", line 332, in _get_value_pos_for_path_collection
    group_pos = float(np.round(np.nanmean(
  File "<__array_function__ internals>", line 180, in nanmean
  File "/media/kokyriakidis/RED/BCBIO/anaconda/envs/postprocessSPRINT/lib/python3.8/site-packages/numpy/lib/nanfunctions.py", line 1048, in nanmean
    avg = _divide_by_count(tot, cnt, out=out)
  File "/media/kokyriakidis/RED/BCBIO/anaconda/envs/postprocessSPRINT/lib/python3.8/site-packages/numpy/lib/nanfunctions.py", line 215, in _divide_by_count
    return np.divide(a, b, out=a, casting='unsafe')
ValueError: output array is read-only

Can I somehow have the CONTROL_Edited category be empty (have only NaN values) and make Annotator work?

Add support for Brunner-Munzel test

https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.brunnermunzel.html

From scipy doc.

The Brunner-Munzel test is a nonparametric test of the null hypothesis that when values are taken one by one from each group, the probabilities of getting large values in both groups are equal. Unlike the Wilcoxon-Mann-Whitney’s U test, this does not require the assumption of equivariance of two groups. Note that this does not assume the distributions are same. This test works on two independent samples, which may have different sizes.

Cannot configure annotator for plot when groups are in y axis

I think I might be doing something wrong here, but...

import seaborn as sns
from statannotations.Annotator import Annotator

iris = sns.load_dataset("iris")
iris = pd.melt(iris, "species", var_name="measurement")
pair_list = [(('sepal_length', 'setosa'),
              ('sepal_length', 'versicolor'),
              ('sepal_length', 'virginica')),
             (('sepal_width', 'setosa'),
              ('sepal_width', 'versicolor'),
              ('sepal_width', 'virginica')),
             (('petal_length', 'setosa'),
              ('petal_length', 'versicolor'),
              ('petal_length', 'virginica')),
             (('petal_width', 'setosa'),
              ('petal_width', 'versicolor'),
              ('petal_width', 'virginica'))]
petal_ax = sns.pointplot(
    data=iris, x="value", y="measurement", hue="species",
    join=False, dodge=.8 - .8 / 3, palette="dark",
    markers="d", scale=.75, errorbar=None
)
annotator = Annotator(ax=petal_ax, 
                        pairs=pair_list, 
                        data=iris, 
                        y="measurement",
                        x="value",
                        hue="species", 
                        order=['sepal_length', 'sepal_width', 'petal_length', 'petal_width'],
                        hue_order=['setosa', 'versicolor', 'virginica'])
annotator.configure(test='Mann-Whitney', text_format='star', loc='outside')
annotator.apply_and_annotate()

Returns

ValueError                                Traceback (most recent call last)
[c:\Users\systemses\Downloads\pyControl\running_analysis](file:///C:/Users/systemses/Downloads/pyControl/running_analysis)[rand].ipynb Cell 9 in 2
      [3](vscode-notebook-cell:/c%3A/Users/systemses/Downloads/pyControl/running_analysis%5Brand%5D.ipynb#X42sZmlsZQ%3D%3D?line=2) pair_list = [(('sepal_length', 'setosa'),
      [4](vscode-notebook-cell:/c%3A/Users/systemses/Downloads/pyControl/running_analysis%5Brand%5D.ipynb#X42sZmlsZQ%3D%3D?line=3)               ('sepal_length', 'versicolor'),
      [5](vscode-notebook-cell:/c%3A/Users/systemses/Downloads/pyControl/running_analysis%5Brand%5D.ipynb#X42sZmlsZQ%3D%3D?line=4)               ('sepal_length', 'virginica')),
   (...)
     [13](vscode-notebook-cell:/c%3A/Users/systemses/Downloads/pyControl/running_analysis%5Brand%5D.ipynb#X42sZmlsZQ%3D%3D?line=12)               ('petal_width', 'versicolor'),
     [14](vscode-notebook-cell:/c%3A/Users/systemses/Downloads/pyControl/running_analysis%5Brand%5D.ipynb#X42sZmlsZQ%3D%3D?line=13)               ('petal_width', 'virginica'))]
     [15](vscode-notebook-cell:/c%3A/Users/systemses/Downloads/pyControl/running_analysis%5Brand%5D.ipynb#X42sZmlsZQ%3D%3D?line=14) petal_ax = sns.pointplot(
     [16](vscode-notebook-cell:/c%3A/Users/systemses/Downloads/pyControl/running_analysis%5Brand%5D.ipynb#X42sZmlsZQ%3D%3D?line=15)     data=iris, x="value", y="measurement", hue="species",
     [17](vscode-notebook-cell:/c%3A/Users/systemses/Downloads/pyControl/running_analysis%5Brand%5D.ipynb#X42sZmlsZQ%3D%3D?line=16)     join=False, dodge=.8 - .8 / 3, palette="dark",
     [18](vscode-notebook-cell:/c%3A/Users/systemses/Downloads/pyControl/running_analysis%5Brand%5D.ipynb#X42sZmlsZQ%3D%3D?line=17)     markers="d", scale=.75, errorbar=None
     [19](vscode-notebook-cell:/c%3A/Users/systemses/Downloads/pyControl/running_analysis%5Brand%5D.ipynb#X42sZmlsZQ%3D%3D?line=18) )
---> [20](vscode-notebook-cell:/c%3A/Users/systemses/Downloads/pyControl/running_analysis%5Brand%5D.ipynb#X42sZmlsZQ%3D%3D?line=19) annotator = Annotator(ax=petal_ax, 
     [21](vscode-notebook-cell:/c%3A/Users/systemses/Downloads/pyControl/running_analysis%5Brand%5D.ipynb#X42sZmlsZQ%3D%3D?line=20)                         pairs=pair_list, 
     [22](vscode-notebook-cell:/c%3A/Users/systemses/Downloads/pyControl/running_analysis%5Brand%5D.ipynb#X42sZmlsZQ%3D%3D?line=21)                         data=iris, 
     [23](vscode-notebook-cell:/c%3A/Users/systemses/Downloads/pyControl/running_analysis%5Brand%5D.ipynb#X42sZmlsZQ%3D%3D?line=22)                         y="measurement",
     [24](vscode-notebook-cell:/c%3A/Users/systemses/Downloads/pyControl/running_analysis%5Brand%5D.ipynb#X42sZmlsZQ%3D%3D?line=23)                         x="value",
     [25](vscode-notebook-cell:/c%3A/Users/systemses/Downloads/pyControl/running_analysis%5Brand%5D.ipynb#X42sZmlsZQ%3D%3D?line=24)                         hue="species", 
     [26](vscode-notebook-cell:/c%3A/Users/systemses/Downloads/pyControl/running_analysis%5Brand%5D.ipynb#X42sZmlsZQ%3D%3D?line=25)                         order=['sepal_length', 'sepal_width', 'petal_length', 'petal_width'],
     [27](vscode-notebook-cell:/c%3A/Users/systemses/Downloads/pyControl/running_analysis%5Brand%5D.ipynb#X42sZmlsZQ%3D%3D?line=26)                         hue_order=['setosa', 'versicolor', 'virginica'])
     [28](vscode-notebook-cell:/c%3A/Users/systemses/Downloads/pyControl/running_analysis%5Brand%5D.ipynb#X42sZmlsZQ%3D%3D?line=27) annotator.configure(test='Mann-Whitney', text_format='star', loc='outside')
     [29](vscode-notebook-cell:/c%3A/Users/systemses/Downloads/pyControl/running_analysis%5Brand%5D.ipynb#X42sZmlsZQ%3D%3D?line=28) annotator.apply_and_annotate()
...
---> 63     raise ValueError(f"Missing x value(s) "
     64                      f"`{render_collection(unmatched_in_order)}` in {x} "
     65                      f"(specified in `order`)")

ValueError: Missing x value(s) `"sepal_width", "petal_length", "sepal_length", "petal_width"` in value (specified in `order`)

Exporting the significance results

Is there any possibility to export the statistical test results (p-value, etc) into variables or list? So far, I cannot find the way how to get the stat test besides the plotting and printing the values.

Seaborn Catplot support

Is there support planned ?

Is it possible to make the current version work with catplot if I work with the FacetGrid that is returned from the sns.catplot ?

For example, maybe passing a function to g.map_dataframe and for each axis to do the annotations ?

Ability to add custom (manual) p_values for box plot with hue

Hi,

It seems likeadding custom (manual) p_values for box plot with hue is not possible. I cannot see an example of it anywhere and it would be very useful please! Thanks!

I guess it would look something like:

p_values = [0.1, 0.2, 0.001]
annot = Annotator(ax = ax, pairs = pairs, x = "Age", hue = "Sex", y = "value")
annot.new_plot(data = data)
annot.configure(loc='outside', test = None).set_pvalues(p_values)

How to hide "ns" annotation

Hello, I don't want to show "ns" in the plot, can I use any paramater to hide "ns"? Juts showing "*" is fit for me. Thanks!

Kruskal-Wallis with Posthoc Dunn implementation

I noticed that the implementation of the Kruskal-Wallis test is somewhat different from what is typically seen in literature (at least in my field).

Statannotations applies a pairwise test on different groups (note that it is not a paired test which is shown in the printed output). Commonly the Kruskal-Wallis test is done on all groups to check if there is any difference and then which differences there are is picked up with a Posthoc Dunn test. I wrote some code earlier today with a Python implementation, this can be found here, note the difference in the results.

Is there an interest to implement some of these Posthoc tests? Scikit-posthocs has the stats needed. At first glance this can likely be added to Annotator._get_results or by creating a PosthocAnnotator class that does something along the lines of my code and pipes that into the Annotator. I could give that a shot if there is sufficient interest.

Annotating boxplot with broken y axis

Hello,
thanks for the package it's great!
I am trying to annotate a boxplot where I want to break the y axis into two but I cannot see the annotation of the data in the bottom part (ax2 subplot)
Here is the code:

from statannotations.Annotator import Annotator
df_samples_media = df_samples.loc[(df_samples["Sample"].str.contains("LPS"))]
assays_list = (df_samples_media["Assay"].unique())
pairs2=[[("CCL8", "WT"),("CCL8", "HOM")] , [("CCL13", "WT"), ("CCL13", "HOM")]]
pairs=[[("CCL2", "WT"),("CCL2", "HOM")]]
hue_parameters= {'data': df_samples_media,
'x': 'Assay',
'y': 'Conc',
"hue": "PTK2B_genotype",
}
fig, (ax, ax2) = plt.subplots(ncols=1, nrows=2, sharex=True)
ax=sns.boxplot(**hue_parameters, ax=ax)
annotator = Annotator(ax, pairs, **hue_parameters)
annotator.configure(test='t-test_ind', text_format='star', loc="inside")
annotator.apply_and_annotate()
ax2=sns.boxplot(**hue_parameters, ax=ax2)
annotator2 = Annotator(ax2, pairs2, **hue_parameters)
annotator2.configure(test='t-test_ind', text_format='star',loc="inside")
annotator2.apply_and_annotate()
ax.set_ylim(500000, 2000000) # outliers only
ax2.set_ylim(0, 90000)
ax2.get_legend().remove()
ax.spines['bottom'].set_visible(False)
ax2.spines['top'].set_visible(False)
ax.xaxis.tick_top()
ax.tick_params(labeltop=False) # don't put tick labels at the top
ax2.xaxis.tick_bottom()
ax.set_ylabel("")
ax.set_xlabel("")
ax2.set_ylabel("")
#adjust distance between subplots
fig.subplots_adjust(hspace=0.5)
fig.text(0.07, 0.5, 'Concentration (pg/ml)', va='center', rotation='vertical')

do you know how I could do that? Is there a way to control the distance of the annotations to the boxplots?
Thanks a lot,
Erica
![plate3_LPS_stats](https
plate3_LPS_stats_broken
://user-images.githubusercontent.com/26386285/152211212-ba5350fe-c839-43af-8b43-fb929d5b4c6d.jpeg)
a

Non bonferroni comparisons corrections have multiple significances?

Hello thank you for this updated version of statannot it's been very useful. I am currently having an issue with non-bonferroni multiple comparisons corrections; they seem to give me two significances like this (with the holms-bonferroni; the "* (ns)" label is what seems strange to me):

Screen Shot 2021-09-06 at 11 23 34 AM

vs. the bonferroni correction, which only gives me a single significance for each comparison:

Screen Shot 2021-09-06 at 11 25 02 AM

Strangely I do get this warning for using holms-bonferroni, but not with bonferroni alone:

/opt/anaconda3/lib/python3.7/site-packages/statannotations/_Plotter.py:338: UserWarning: Invalid x-position found. Are the same parameters passed to seaborn and statannotations calls? or are there few data points?
  "Invalid x-position found. Are the same parameters passed "

Thanks in advance.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.