plotnine.stats.stat_qq_line¶
- class plotnine.stats.stat_qq_line(mapping: Aes | None = None, data: DataLike | None = None, **kwargs: Any)[source]¶
Calculate line through quantile-quantile plot
Usage
stat_qq_line(mapping=None, data=None, geom='qq_line', position='identity', na_rm=False, line_p=(0.25, 0.75), distribution='norm', quantiles=None, dparams={}, fullrange=False, alpha_beta=(0.375, 0.375), **kwargs)
Only the
mapping
anddata
can be positional, the rest must be keyword arguments.**kwargs
can be aesthetics (or parameters) used by thegeom
.- Parameters:
- mapping
aes
, optional Aesthetic mappings created with
aes()
. If specified andinherit.aes=True
, it is combined with the default mapping for the plot. You must supply mapping if there is no plot mapping.Aesthetic
Default value
sample
The bold aesthetics are required.
- data
dataframe
, optional The data to be displayed in this layer. If
None
, the data from from theggplot()
call is used. If specified, it overrides the data from theggplot()
call.- geom
str
or geom, optional (default:geom_qq_line
) The statistical transformation to use on the data for this layer. If it is a string, it must be the registered and known to Plotnine.
- position
str
or position, optional (default:position_identity
) Position adjustment. If it is a string, it must be registered and known to Plotnine.
- na_rmbool, optional (default:
False
) If
False
, removes missing values with a warning. IfTrue
silently removes missing values.- distribution
str
(default:norm
) Distribution or distribution function name. The default is norm for a normal probability plot. Objects that look enough like a stats.distributions instance (i.e. they have a ppf method) are also accepted. See
scipy stats
for available distributions.- dparams
dict
, optional Distribution-specific shape parameters (shape parameters plus location and scale).
- quantilesarray_like, optional
Probability points at which to calculate the theoretical quantile values. If provided, must be the same number as as the sample data points. The default is to use calculated theoretical points, use to
alpha_beta
control how these points are generated.- alpha_beta
tuple
Parameter values to use when calculating the quantiles. Default is
(3/8, 3/8)
.- line_p
tuple
, optional Quantiles to use when fitting a Q-Q line. Must be 2 values. Default is
(0.25, 0.75)
.- fullrangebool
If
True
the fit will span the full range of the plot.
- mapping
See also
scipy.stats.mstats.plotting_positions
Uses
alpha_beta
to calculate the quantiles.