Ejemplo n.º 1
0
def countplot(data, **kwargs):
    def sns_countplot(x, y, hue, color, saturation):  # pragma: no cover
        x, y, hue, color = ut.widget2py(x, y, hue, color)
        ax, fig, _ = ut.get_ax_fig_plt()
        return sns.countplot(x=x,
                             y=y,
                             hue=hue,
                             data=data,
                             order=None,
                             hue_order=None,
                             orient=None,
                             color=color,
                             palette=None,
                             saturation=saturation,
                             ax=ax,
                             **kwargs)

    allcols = ["None"] + list(data.keys())
    return ipw.interact_manual(
        sns_countplot,
        x=allcols,
        y=allcols,
        hue=allcols,
        color=ut.colors_dropdow(),
        saturation=ut.saturation_slider(default=0.75),
    )
Ejemplo n.º 2
0
def swarmplot(data, **kwargs):
    def sns_swarmplot(x, y, hue, split, orient, color, size,
                      linewidth):  # pragma: no cover
        x, y, hue, orient, color = ut.widget2py(x, y, hue, orient, color)
        ax, fig, _ = ut.get_ax_fig_plt()
        return sns.swarmplot(x=x,
                             y=y,
                             hue=hue,
                             data=data,
                             order=None,
                             hue_order=None,
                             split=split,
                             orient=orient,
                             color=color,
                             palette=None,
                             size=size,
                             edgecolor='gray',
                             linewidth=linewidth,
                             ax=ax,
                             **kwargs)

    allcols = ["None"] + list(data.keys())
    return ipw.interact_manual(
        sns_swarmplot,
        x=allcols,
        y=allcols,
        hue=allcols,
        split=False,
        orient=["None", "v", "h"],
        color=ut.colors_dropdow(),
        size=ut.size_slider(default=5),
        linewidth=ut.linewidth_slider(default=0),
    )
Ejemplo n.º 3
0
def barplot(data, **kwargs):
    def sns_barplot(x, y, hue, orient, color, saturation):  # pragma: no cover
        x, y, hue, orient, color = ut.widget2py(x, y, hue, orient, color)
        ax, fig, _ = ut.get_ax_fig_plt()
        return sns.barplot(
            x=x,
            y=y,
            hue=hue,
            data=data,
            order=None,
            hue_order=None,  # estimator=<function mean>,
            ci=95,
            n_boot=1000,
            units=None,
            orient=orient,
            color=color,
            palette=None,
            saturation=saturation,
            errcolor='.26',
            ax=ax,
            **kwargs)  # errwidth=None, capsize=None, # New args added in ??

    allcols = ["None"] + list(data.keys())
    return ipw.interact_manual(
        sns_barplot,
        x=allcols,
        y=allcols,
        hue=allcols,
        orient=["None", "v", "h"],
        color=ut.colors_dropdow(),
        saturation=ut.saturation_slider(default=0.75),
    )
Ejemplo n.º 4
0
def violinplot(data, **kwargs):

    def sns_violinplot(x, y, hue, bw, scale, inner, split, orient, color, saturation): # pragma: no cover
        x, y, hue, inner, orient, color = ut.widget2py(x, y, hue, inner, orient, color)
        ax, fig, _ = ut.get_ax_fig_plt()

        sns.violinplot(x=x, y=y, hue=hue, data=data, order=None, hue_order=None,
                       bw=bw, cut=2, scale=scale, scale_hue=True,
                       gridsize=100, width=0.8, inner=inner, split=split, orient=orient,
                       linewidth=None, color=color, palette=None, saturation=saturation, ax=ax, **kwargs)

    allcols = ["None"] + list(data.keys())
    return ipw.interact_manual(
                sns_violinplot,
                x=allcols,
                y=allcols,
                hue=allcols,
                bw=["scott", "silverman", "float"],
                scale=["area", "count", "width"],
                inner=["box", "quartile", "point", "stick", "None"],
                split=False,
                orient=["None", "v", "h"],
                color=ut.colors_dropdow(),
                saturation=ut.saturation_slider(default=0.75),
            )
Ejemplo n.º 5
0
def boxplot(data, **kwargs):
    def sns_boxplot(x, y, hue, orient, color, saturation,
                    notch):  # pragma: no cover
        x, y, hue, orient, color = ut.widget2py(x, y, hue, orient, color)
        ax, fig, _ = ut.get_ax_fig_plt()
        return sns.boxplot(x=x,
                           y=y,
                           hue=hue,
                           data=data,
                           order=None,
                           hue_order=None,
                           orient=orient,
                           color=color,
                           palette=None,
                           saturation=saturation,
                           width=0.8,
                           fliersize=5,
                           linewidth=None,
                           whis=1.5,
                           notch=notch,
                           ax=ax,
                           **kwargs)

    allcols = ["None"] + list(data.keys())
    return ipw.interact_manual(
        sns_boxplot,
        x=allcols,
        y=allcols,
        hue=allcols,
        orient=["None", "v", "h"],
        color=ut.colors_dropdow(),
        saturation=ut.saturation_slider(default=0.75),
        notch=False,
    )
Ejemplo n.º 6
0
def jointplot(data,
              joint_kws=None,
              marginal_kws=None,
              annot_kws=None,
              **kwargs):
    def sns_joinplot(x, y, kind, color):  # pragma: no cover
        x, y, color = ut.widget2py(x, y, color)
        # TODO: stat_func
        return sns.jointplot(
            x,
            y,
            data=data,
            kind=kind,  # stat_func=<function pearsonr>,
            color=color,
            size=6,
            ratio=5,
            space=0.2,
            dropna=True,
            xlim=None,
            ylim=None,
            joint_kws=joint_kws,
            marginal_kws=marginal_kws,
            annot_kws=annot_kws,
            **kwargs)

    allcols = ["None"] + list(data.keys())
    return ipw.interact_manual(
        sns_joinplot,
        x=allcols,
        y=allcols,
        kind=["scatter", "reg", "resid", "kde", "hex"],
        color=ut.colors_dropdow(),
        #button=_help_button("joinplot"),
    )
Ejemplo n.º 7
0
def countplot(data, **kwargs):

    def sns_countplot(x, y, hue, color, saturation): # pragma: no cover
        x, y, hue, color = ut.widget2py(x, y, hue, color)
        ax, fig, _ = ut.get_ax_fig_plt()
        return sns.countplot(x=x, y=y, hue=hue, data=data, order=None, hue_order=None, orient=None,
                             color=color, palette=None, saturation=saturation, ax=ax, **kwargs)

    allcols = ["None"] + list(data.keys())
    return ipw.interact_manual(
                sns_countplot,
                x=allcols,
                y=allcols,
                hue=allcols,
                color=ut.colors_dropdow(),
                saturation=ut.saturation_slider(default=0.75),
            )
Ejemplo n.º 8
0
def jointplot(data, joint_kws=None, marginal_kws=None, annot_kws=None, **kwargs):

    def sns_joinplot(x, y, kind, color):  # pragma: no cover
        x, y, color = ut.widget2py(x, y, color)
        # TODO: stat_func
        return sns.jointplot(x, y, data=data, kind=kind, # stat_func=<function pearsonr>,
                            color=color, size=6, ratio=5, space=0.2, dropna=True, xlim=None, ylim=None,
                            joint_kws=joint_kws, marginal_kws=marginal_kws, annot_kws=annot_kws, **kwargs)

    allcols = ["None"] + list(data.keys())
    return ipw.interact_manual(
                sns_joinplot,
                x=allcols,
                y=allcols,
                kind=["scatter", "reg", "resid", "kde", "hex"],
                color=ut.colors_dropdow(),
                #button=_help_button("joinplot"),
            )
Ejemplo n.º 9
0
def factorplot(data, facet_kws=None, **kwargs):
    def sns_factorplot(x, y, hue, color, kind, size,
                       legend):  # pragma: no cover
        x, y, hue, color = ut.widget2py(x, y, hue, color)
        return sns.factorplot(
            x=x,
            y=y,
            hue=hue,
            data=data,
            row=None,
            col=None,
            col_wrap=None,  # estimator=<function mean>,
            ci=95,
            n_boot=1000,
            units=None,
            order=None,
            hue_order=None,
            row_order=None,
            col_order=None,
            kind=kind,
            size=size,
            aspect=1,
            orient=None,
            color=color,
            palette=None,
            legend=legend,
            legend_out=True,
            sharex=True,
            sharey=True,
            margin_titles=False,
            facet_kws=facet_kws,
            **kwargs)

    allcols = ["None"] + list(data.keys())
    return ipw.interact_manual(
        sns_factorplot,
        x=allcols,
        y=allcols,
        hue=allcols,
        color=ut.colors_dropdow(),
        kind=["point", "bar", "count", "box", "violin", "strip"],
        size=ut.size_slider(default=4),
        legend=True,
    )
Ejemplo n.º 10
0
def barplot(data, **kwargs):

    def sns_barplot(x, y, hue, orient, color, saturation): # pragma: no cover
        x, y, hue, orient, color = ut.widget2py(x, y, hue, orient, color)
        ax, fig, _ = ut.get_ax_fig_plt()
        return sns.barplot(x=x, y=y, hue=hue, data=data, order=None, hue_order=None, # estimator=<function mean>,
                           ci=95, n_boot=1000, units=None, orient=orient, color=color, palette=None,
                           saturation=saturation, errcolor='.26', ax=ax, **kwargs) # errwidth=None, capsize=None, # New args added in ??

    allcols = ["None"] + list(data.keys())
    return ipw.interact_manual(
                sns_barplot,
                x=allcols,
                y=allcols,
                hue=allcols,
                orient=["None", "v", "h"],
                color=ut.colors_dropdow(),
                saturation=ut.saturation_slider(default=0.75),
            )
Ejemplo n.º 11
0
def boxplot(data, **kwargs):

    def sns_boxplot(x, y, hue, orient, color, saturation, notch): # pragma: no cover
        x, y, hue, orient, color = ut.widget2py(x, y, hue, orient, color)
        ax, fig, _ = ut.get_ax_fig_plt()
        return sns.boxplot(x=x, y=y, hue=hue, data=data, order=None, hue_order=None, orient=orient,
                          color=color, palette=None, saturation=saturation, width=0.8, fliersize=5, linewidth=None,
                          whis=1.5, notch=notch, ax=ax, **kwargs)

    allcols = ["None"] + list(data.keys())
    return ipw.interact_manual(
                sns_boxplot,
                x=allcols,
                y=allcols,
                hue=allcols,
                orient=["None", "v", "h"],
                color=ut.colors_dropdow(),
                saturation=ut.saturation_slider(default=0.75),
                notch=False,
            )
Ejemplo n.º 12
0
def pointplot(data, **kwargs):

    def sns_pointplot(x, y, hue, split, join, orient, color, linewidth): # pragma: no cover
        x, y, hue, orient, color = ut.widget2py(x, y, hue, orient, color)
        ax, fig, _ = ut.get_ax_fig_plt()
        return sns.pointplot(x=x, y=y, hue=hue, data=data, order=None, hue_order=None, # estimator=<function mean>,
                            ci=95, n_boot=1000, units=None, markers='o', linestyles='-', dodge=False, join=join, scale=1,
                            orient=orient, color=color, palette=None, ax=ax, errwidth=None, capsize=None, **kwargs)

    allcols = ["None"] + list(data.keys())
    return ipw.interact_manual(
                sns_pointplot,
                x=allcols,
                y=allcols,
                hue=allcols,
                split=False,
                join=True,
                orient=["None", "v", "h"],
                color=ut.colors_dropdow(),
                linewidth=ut.linewidth_slider(default=0),
            )
Ejemplo n.º 13
0
def swarmplot(data, **kwargs):

    def sns_swarmplot(x, y, hue, split, orient, color, size, linewidth): # pragma: no cover
        x, y, hue, orient, color = ut.widget2py(x, y, hue, orient, color)
        ax, fig, _ = ut.get_ax_fig_plt()
        return sns.swarmplot(x=x, y=y, hue=hue, data=data, order=None, hue_order=None,
                            split=split, orient=orient, color=color, palette=None, size=size,
                            edgecolor='gray', linewidth=linewidth, ax=ax, **kwargs)

    allcols = ["None"] + list(data.keys())
    return ipw.interact_manual(
                sns_swarmplot,
                x=allcols,
                y=allcols,
                hue=allcols,
                split=False,
                orient=["None", "v", "h"],
                color=ut.colors_dropdow(),
                size=ut.size_slider(default=5),
                linewidth=ut.linewidth_slider(default=0),
            )
Ejemplo n.º 14
0
def factorplot(data, facet_kws=None, **kwargs):

    def sns_factorplot(x, y, hue, color, kind, size, legend):  # pragma: no cover
        x, y, hue, color = ut.widget2py(x, y, hue, color)
        return sns.factorplot(x=x, y=y, hue=hue, data=data, row=None, col=None, col_wrap=None, # estimator=<function mean>,
                       ci=95, n_boot=1000, units=None, order=None, hue_order=None, row_order=None, col_order=None,
                       kind=kind, size=size, aspect=1, orient=None, color=color, palette=None,
                       legend=legend, legend_out=True, sharex=True, sharey=True, margin_titles=False,
                       facet_kws=facet_kws, **kwargs)

    allcols = ["None"] + list(data.keys())
    return ipw.interact_manual(
                sns_factorplot,
                x=allcols,
                y=allcols,
                hue=allcols,
                color=ut.colors_dropdow(),
                kind=["point", "bar", "count", "box", "violin", "strip"],
                size=ut.size_slider(default=4),
                legend=True,
            )