publiplots.pointplot

publiplots.pointplot(data, x=None, y=None, hue=None, order=None, hue_order=None, estimator='mean', errorbar=('ci', 95), n_boot=1000, seed=None, units=None, weights=None, color=None, palette=None, markers='o', linestyle=None, linestyles=None, dodge=False, orient=None, capsize=0, edgecolor=None, err_kws=None, alpha=None, linewidth=None, markersize=None, markeredgewidth=None, ax=None, title='', xlabel='', ylabel='', legend=True, legend_kws=None, annotate=None, **kwargs)[source]

Create a point plot with publiplots styling.

Point plots show point estimates and error bars for numeric data grouped by categorical variables. Points are connected by lines to emphasize trends over categories. Markers use a distinctive double-layer style with white background and semi-transparent colored fill.

Parameters:
  • data (pd.DataFrame) – Input data containing x, y, and optional hue columns.

  • x (str, optional) – Column name for x-axis (categorical).

  • y (str, optional) – Column name for y-axis (numeric).

  • hue (str, optional) – Column name for grouping variable that will produce lines with different colors and markers.

  • order (list, optional) – Order to plot the categorical levels in.

  • hue_order (list, optional) – Order to plot the hue levels in.

  • estimator (str, default="mean") – Statistical function to estimate within each categorical bin. Options: “mean”, “median”, etc.

  • errorbar (str or tuple, default=("ci", 95)) –

    Error-bar specification. Accepts every seaborn-native form — see seaborn.pointplot() for the full list: ("ci", level), ("pi", level), ("se", mult), "sd", None.

    publiplots additionally supports ("custom", (lower_col, upper_col)) to draw whisker endpoints at precomputed lower/upper bounds stored on the data (e.g. odds-ratio CIs, effect sizes with externally-computed bootstrap intervals). When this form is used, estimator is forced to "median" and any n_boot / seed arguments are ignored.

    Example:

    pp.pointplot(
        data=df, x='gene', y='log2_or',
        errorbar=('custom', ('log2_lower', 'log2_upper')),
    )
    

  • n_boot (int, default=1000) – Number of bootstrap iterations for computing confidence intervals.

  • seed (int, optional) – Seed for random number generator.

  • units (str, optional) – Column for sampling units (for nested data).

  • weights (str, optional) – Column for observation weights.

  • color (str, optional) – Fixed color for all points (only used when hue is None).

  • palette (str, dict, list, or None) – Color palette for hue values: - str: palette name (e.g., “pastel”) - dict: mapping of hue values to colors - list: list of colors - None: uses default palette

  • markers (bool, list, dict, optional. Default: "o") – Markers to use for different hue levels: - True: use default marker set - list: list of marker symbols (e.g., [“o”, “^”, “s”]) - dict: mapping of hue values to markers - None: uses default marker “o” for all points

  • linestyles (str, list, dict, optional) – Line styles to use for different hue levels.

  • dodge (bool or float, default=False) – Amount to separate points for different hue levels along the categorical axis.

  • orient (str, optional) – Orientation of the plot (‘v’ or ‘h’).

  • capsize (float, default=0) – Width of error bar caps.

  • err_kws (dict, optional) – Additional keyword arguments for error bar styling. Example: {‘linewidth’: 1.5, ‘alpha’: 0.7}

  • alpha (float, default=0.4) – Transparency level for marker fill (0-1).

  • linewidth (float, default=2.0) – Width of marker edges and connecting lines.

  • markersize (float, default=10) – Size of markers.

  • markeredgewidth (float, default=1.0) – Width of marker edges.

  • ax (Axes, optional) – Matplotlib axes object. If None, creates new figure.

  • title (str, default="") – Plot title.

  • xlabel (str, default="") – X-axis label. If empty, uses x column name.

  • ylabel (str, default="") – Y-axis label. If empty, uses y column name.

  • legend (bool, default=True) – Whether to show legend.

  • legend_kws (dict, optional) – Keyword arguments for legend builder: - hue_label : str, optional - Title for the hue legend.

  • **kwargs – Additional keyword arguments passed to seaborn.pointplot().

Returns:

The axes where the plot was drawn.

Return type:

Axes

Examples

Simple point plot: >>> ax = pp.pointplot(data=df, x=”time”, y=”value”)

Point plot with grouping: >>> ax = pp.pointplot( … data=df, x=”time”, y=”value”, hue=”group”, … palette={‘Control’: ‘#8E8EC1’, ‘Treated’: ‘#75B375’} … )

Point plot with custom markers: >>> ax = pp.pointplot( … data=df, x=”time”, y=”value”, hue=”group”, … markers=[“o”, “D”], errorbar=”se” … )