Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ECDF Stat #832

Merged
merged 17 commits into from
Aug 2, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add stat_ecdf() function. Tiny fixes in other stat functions.
  • Loading branch information
ASmirnov-HORIS committed Jul 27, 2023
commit 9d017f56be127344511743b42f5678faf5be4d5c
35 changes: 30 additions & 5 deletions python-package/lets_plot/plot/stat.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
#
# Stats - functions, drawing attention to the statistical transformation rather than the visual appearance.
#
__all__ = ['stat_summary', 'stat_summary_bin']
__all__ = ['stat_summary', 'stat_summary_bin', 'stat_ecdf']


def stat_summary(mapping=None, *, data=None, geom='pointrange',
def stat_summary(mapping=None, *, data=None, geom=None,
position=None, show_legend=None, sampling=None, tooltips=None,
orientation=None,
fun=None, fun_min=None, fun_max=None,
Expand Down Expand Up @@ -152,7 +152,8 @@ def stat_summary(mapping=None, *, data=None, geom='pointrange',
position=position_nudge(x=.1), color="blue")

"""
return _geom(geom,
summary_geom = geom if geom is not None else 'pointrange'
return _geom(summary_geom,
mapping=mapping,
data=data,
stat='summary',
Expand All @@ -167,7 +168,7 @@ def stat_summary(mapping=None, *, data=None, geom='pointrange',
**other_args)


def stat_summary_bin(mapping=None, *, data=None, geom='pointrange',
def stat_summary_bin(mapping=None, *, data=None, geom=None,
position=None, show_legend=None, sampling=None, tooltips=None,
orientation=None,
fun=None, fun_min=None, fun_max=None,
Expand Down Expand Up @@ -325,7 +326,8 @@ def stat_summary_bin(mapping=None, *, data=None, geom='pointrange',
geom_point()

"""
return _geom(geom,
summary_bin_geom = geom if geom is not None else 'pointrange'
return _geom(summary_bin_geom,
mapping=mapping,
data=data,
stat='summarybin',
Expand All @@ -340,3 +342,26 @@ def stat_summary_bin(mapping=None, *, data=None, geom='pointrange',
center=center, boundary=boundary,
color_by=color_by, fill_by=fill_by,
**other_args)


def stat_ecdf(mapping=None, *, data=None, geom=None,
position=None, show_legend=None, sampling=None, tooltips=None,
orientation=None,
n=None, pad=None,
color_by=None,
**other_args):
ecdf_geom = geom if geom is not None else 'step'
ecdf_pad = pad if pad is not None else True
return _geom(ecdf_geom,
mapping=mapping,
data=data,
stat='ecdf',
position=position,
show_legend=show_legend,
sampling=sampling,
tooltips=tooltips,
orientation=orientation,
n=n,
pad=ecdf_pad,
color_by=color_by,
**other_args)