maximtrp / scikit-posthocs

Multiple Pairwise Comparisons (Post Hoc) Tests in Python
https://scikit-posthocs.rtfd.io
MIT License
351 stars 40 forks source link

Significance Plots Colour Bar Breaks Using Matplotlib >= 3.5.0 #51

Closed MattyB95 closed 2 years ago

MattyB95 commented 2 years ago

It appears the way Matplotlib handles colour bars from version 3.5.0 breaks the significance plots colour bar:

To Reproduce

import matplotlib.pyplot as plt
import scikit_posthocs as sp
import statsmodels.api as sa

x = sa.datasets.get_rdataset('iris').data
x.columns = x.columns.str.replace('.', '')
pc = sp.posthoc_ttest(x, val_col='SepalWidth', group_col='Species', p_adjust='holm')
heatmap_args = {'linewidths': 0.25, 'linecolor': '0.5', 'clip_on': False, 'square': True,
                'cbar_ax_bbox': [0.82, 0.35, 0.04, 0.3]}
sp.sign_plot(pc, **heatmap_args)
plt.show()

issue

Expected behaviour

expected

maximtrp commented 2 years ago

Thank you for this fix! I probably need to test the other functions. Time passes and third-party packages change their behavior.