Statistics - Maple Programming Help

Home : Support : Online Help : Graphics : Statistics : Statistics/DensityPlot

Statistics

 DensityPlot
 plot the density of a random variable

 Calling Sequence DensityPlot(X, options, plotoptions) DensityPlot['interactive'](X)

Parameters

 X - random variable or distribution options - (optional) equation(s) of the form range=value; specify options for generating the density plot plotoptions - options to be passed to the plots[display] command

Description

 • The DensityPlot command plots the density of the specified random variable. By default, the range is taken between the 1st and the 99th percentiles of the underlying distribution.
 • The first parameter can be a distribution (see Statistics[Distribution]), a random variable, or an algebraic expression involving random variables (see Statistics[RandomVariable]).
 • It must be possible to evaluate the PDF (for continuous distributions) or the ProbabilityFunction (for discrete distributions) to numeric constants.
 • If the ['interactive'] option is used, then a dialog box appears that allows for customized creation of the plot.

Options

 The options argument can contain one or more of the options shown below. All unrecognized options will be passed to the plots[display] command. See plot[options] for details.
 • range=deduce or range
 By default this is deduce.  This option is used to bound the horizontal real range on which the density is plotted.

Examples

 > $\mathrm{with}\left(\mathrm{Statistics}\right):$
 > $X≔\mathrm{RandomVariable}\left(\mathrm{Normal}\left(0,1\right)\right)$
 ${X}{≔}{\mathrm{_R}}$ (1)
 > $Y≔\mathrm{RandomVariable}\left(\mathrm{Normal}\left(0,1\right)\right)$
 ${Y}{≔}{\mathrm{_R0}}$ (2)
 > $\mathrm{DensityPlot}\left(X,\mathrm{range}=-2..2\right)$
 > $\mathrm{DensityPlot}\left(\frac{X}{Y},\mathrm{range}=-2..2,\mathrm{color}="Niagara Red"\right)$

Plot options such as background color or gridlines are passed to the plots:-display command:

 > $\mathrm{DensityPlot}\left(\mathrm{GeometricDistribution}\left(\frac{1}{3}\right),\mathrm{background}="LightGrey",\mathrm{gridlines}\right)$
 >