- seaborn.pointplot(
*data=None*,***,*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*,*hue_norm=None*,*markers=<default>*,*linestyles=<default>*,*dodge=False*,*log_scale=None*,*native_scale=False*,*orient=None*,*capsize=0*,*formatter=None*,*legend='auto'*,*err_kws=None*,*ci=<deprecated>*,*errwidth=<deprecated>*,*join=<deprecated>*,*scale=<deprecated>*,*ax=None*,***kwargs*)# Show point estimates and errors using lines with markers.

A point plot represents an estimate of central tendency for a numericvariable by the position of the dot and provides some indication of theuncertainty around that estimate using error bars.

Point plots can be more useful than bar plots for focusing comparisonsbetween different levels of one or more categorical variables. They areparticularly adept at showing interactions: how the relationship betweenlevels of one categorical variable changes across levels of a secondcategorical variable. The lines that join each point from the same

`hue`

level allow interactions to be judged by differences in slope, which iseasier for the eyes than comparing the heights of several groups of pointsor bars.See the tutorial for more information.

Note

By default, this function treats one of the variables as categoricaland draws data at ordinal positions (0, 1, … n) on the relevant axis.As of version 0.13.0, this can be disabled by setting

`native_scale=True`

.- Parameters:
**data**DataFrame, Series, dict, array, or list of arraysDataset for plotting. If

`x`

and`y`

are absent, this isinterpreted as wide-form. Otherwise it is expected to be long-form.**x, y, hue**names of variables in`data`

or vector dataInputs for plotting long-form data. See examples for interpretation.

**order, hue_order**lists of stringsOrder to plot the categorical levels in; otherwise the levels areinferred from the data objects.

**estimator**string or callable that maps vector -> scalarStatistical function to estimate within each categorical bin.

**errorbar**string, (string, number) tuple, callable or NoneName of errorbar method (either “ci”, “pi”, “se”, or “sd”), or a tuplewith a method name and a level parameter, or a function that maps from avector to a (min, max) interval, or None to hide errorbar. See theerrorbar tutorial for more information.

New in version v0.12.0.

**n_boot**intNumber of bootstrap samples used to compute confidence intervals.

**seed**int,`numpy.random.Generator`

, or`numpy.random.RandomState`

Seed or random number generator for reproducible bootstrapping.

**units**name of variable in`data`

or vector dataIdentifier of sampling units; used by the errorbar function toperform a multilevel bootstrap and account for repeated measures

**weights**name of variable in`data`

or vector dataData values or column used to compute weighted statistics.Note that the use of weights may limit other statistical options.

New in version v0.13.1.

**color**matplotlib colorSingle color for the elements in the plot.

**palette**palette name, list, or dictColors to use for the different levels of the

`hue`

variable. Shouldbe something that can be interpreted by color_palette(), or adictionary mapping hue levels to matplotlib colors.**markers**string or list of stringsMarkers to use for each of the

`hue`

levels.**linestyles**string or list of stringsLine styles to use for each of the

`hue`

levels.**dodge**bool or floatAmount to separate the points for each level of the

`hue`

variable alongthe categorical axis. Setting to`True`

will apply a small default.**log_scale**bool or number, or pair of bools or numbersSet axis scale(s) to log. A single value sets the data axis for any numericaxes in the plot. A pair of values sets each axis independently.Numeric values are interpreted as the desired base (default 10).When

`None`

or`False`

, seaborn defers to the existing Axes scale.New in version v0.13.0.

**native_scale**boolWhen True, numeric or datetime values on the categorical axis will maintaintheir original scaling rather than being converted to fixed indices.

New in version v0.13.0.

**orient**“v” | “h” | “x” | “y”Orientation of the plot (vertical or horizontal). This is usuallyinferred based on the type of the input variables, but it can be usedto resolve ambiguity when both

`x`

and`y`

are numeric or whenplotting wide-form data.Changed in version v0.13.0: Added ‘x’/’y’ as options, equivalent to ‘v’/’h’.

**capsize**floatWidth of the “caps” on error bars, relative to bar spacing.

**formatter**callableFunction for converting categorical data into strings. Affects both groupingand tick labels.

New in version v0.13.0.

**legend**“auto”, “brief”, “full”, or FalseHow to draw the legend. If “brief”, numeric

`hue`

and`size`

variables will be represented with a sample of evenly spaced values.If “full”, every group will get an entry in the legend. If “auto”,choose between brief or full representation based on number of levels.If`False`

, no legend data is added and no legend is drawn.New in version v0.13.0.

**err_kws**dictParameters of

`matplotlib.lines.Line2D`

, for the error bar artists.New in version v0.13.0.

**ci**floatLevel of the confidence interval to show, in [0, 100].

Deprecated since version v0.12.0: Use

`errorbar=("ci", ...)`

.**errwidth**floatThickness of error bar lines (and caps), in points.

Deprecated since version 0.13.0: Use

`err_kws={'linewidth': ...}`

.**join**boolIf

`True`

, connect point estimates with a line.Deprecated since version v0.13.0: Set

`linestyle="none"`

to remove the lines between the points.**scale**floatScale factor for the plot elements.

Deprecated since version v0.13.0: Control element sizes with

`matplotlib.lines.Line2D`

parameters.**ax**matplotlib AxesAxes object to draw the plot onto, otherwise uses the current Axes.

**kwargs**key, value mappingsOther parameters are passed through to

`matplotlib.lines.Line2D`

.New in version v0.13.0.

- Returns:
**ax**matplotlib AxesReturns the Axes object with the plot drawn onto it.

See also

- barplot
Show point estimates and confidence intervals using bars.

- catplot
Combine a categorical plot with a FacetGrid.

Notes

It is important to keep in mind that a point plot shows only the mean (orother estimator) value, but in many cases it may be more informative toshow the distribution of values at each level of the categorical variables.In that case, other approaches such as a box or violin plot may be moreappropriate.

Examples

Group by a categorical variable and plot aggregated values, with confidence intervals:

sns.pointplot(data=penguins, x="island", y="body_mass_g")

Add a second layer of grouping and differentiate with color:

sns.pointplot(data=penguins, x="island", y="body_mass_g", hue="sex")

Redundantly code the

`hue`

variable using the markers and linestyles for better accessibility:sns.pointplot( data=penguins, x="island", y="body_mass_g", hue="sex", markers=["o", "s"], linestyles=["-", "--"],)

Use the error bars to represent the standard deviation of each distribution:

sns.pointplot(data=penguins, x="island", y="body_mass_g", errorbar="sd")

Customize the appearance of the plot:

sns.pointplot( data=penguins, x="body_mass_g", y="island", errorbar=("pi", 100), capsize=.4, color=".5", linestyle="none", marker="D",)

“Dodge” the artists along the categorical axis to reduce overplotting:

sns.pointplot(data=penguins, x="sex", y="bill_depth_mm", hue="species", dodge=True)

Dodge by a specific amount, relative to the width allotted for each level:

sns.stripplot( data=penguins, x="species", y="bill_depth_mm", hue="sex", dodge=True, alpha=.2, legend=False,)sns.pointplot( data=penguins, x="species", y="bill_depth_mm", hue="sex", dodge=.4, linestyle="none", errorbar=None, marker="_", markersize=20, markeredgewidth=3,)

When variables are not explicitly assigned and the dataset is two-dimensional, the plot will aggregate over each column:

flights_wide = flights.pivot(index="year", columns="month", values="passengers")sns.pointplot(flights_wide)

With one-dimensional data, each value is plotted (relative to its key or index when available):

sns.pointplot(flights_wide["Jun"])

Control the formatting of the categorical variable as it appears in the tick labels:

sns.pointplot(flights_wide["Jun"], formatter=lambda x: f"'{x % 1900}")

Or preserve the native scale of the grouping variable:

ax = sns.pointplot(flights_wide["Jun"], native_scale=True)ax.plot(1955, 335, marker="*", color="r", markersize=10)

# seaborn.pointplot — seaborn 0.13.2 documentation (2024)

Top Articles

Leaders: How Your Values Affect Organizational Values

10 Characteristics of Effective Learning and How to Observe Them

K.c. Joy Plastic Surgery

equip - Englisch-Deutsch Übersetzung | PONS

There’s a lot more to the Kamala Harris memes than you think | TechCrunch

Dallas Summer Musicals Login

Polyhaven Hdri

Viking Gersemi 7 nt cruise dep Amsterdam 5 Dec 2024 from $8,795pp

Lfp Livonia Family Physicians Village Medical Group

Continuing Professional Education for CPAs

2022 Basketball 247

Stoddard工厂Stoddard现货Stoddard价格

Latest Posts

Article information

Author: Greg Kuvalis

Last Updated:

Views: 5941

Rating: 4.4 / 5 (55 voted)

Reviews: 94% of readers found this page helpful

Author information

Name: Greg Kuvalis

Birthday: 1996-12-20

Address: 53157 Trantow Inlet, Townemouth, FL 92564-0267

Phone: +68218650356656

Job: IT Representative

Hobby: Knitting, Amateur radio, Skiing, Running, Mountain biking, Slacklining, Electronics

Introduction: My name is Greg Kuvalis, I am a witty, spotless, beautiful, charming, delightful, thankful, beautiful person who loves writing and wants to share my knowledge and understanding with you.