Skip to content

Commit

Permalink
Merge pull request #239 from gedeck/patch-1
Browse files Browse the repository at this point in the history
Remove dependency on scipy._morestats
  • Loading branch information
raphaelvallat authored Feb 19, 2022
2 parents b81cbfd + b138b25 commit c9a5e41
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions pingouin/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,11 +334,6 @@ def qqplot(x, dist='norm', sparams=(), confidence=.95, figsize=(5, 4),
>>> sns.set_style('darkgrid')
>>> ax = pg.qqplot(x, dist='norm', sparams=(mean, std))
"""
try:
from scipy.stats._morestats import _add_axis_labels_title
except ImportError: # Fallback for scipy<1.8.0
from scipy.stats.morestats import _add_axis_labels_title

if isinstance(dist, str):
dist = getattr(stats, dist)

Expand Down Expand Up @@ -376,10 +371,9 @@ def qqplot(x, dist='norm', sparams=(), confidence=.95, figsize=(5, 4),

ax.plot(theor, observed, 'bo')

_add_axis_labels_title(ax,
xlabel='Theoretical quantiles',
ylabel='Ordered quantiles',
title='Q-Q Plot')
ax.set_xlabel('Theoretical quantiles')
ax.set_ylabel('Ordered quantiles')
ax.set_title('Q-Q Plot')

# Add diagonal line
end_pts = [ax.get_xlim(), ax.get_ylim()]
Expand Down

0 comments on commit c9a5e41

Please sign in to comment.