Statistics
DensityPlot
plot the density of a random variable
Calling Sequence
Parameters
Description
Options
Examples
Compatibility
DensityPlot(X, options, plotoptions)
DensityPlot['interactive'](X)
X
-
random variable or distribution
options
(optional) equation(s) of the form option=value where option is one of discont or range; specify options for generating the density plot
plotoptions
options to be passed to the plots[display] command
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.
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.
discont=true or false
Allows detection of discontinuities. The discont option can only be specified when X contains at least one continuous random variable. By default discont is set to false. For details, see plot/discont.
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.
with⁡Statistics:
X≔RandomVariable⁡Normal⁡0,1
X≔_R
Y≔RandomVariable⁡Normal⁡0,1
Y≔_R0
DensityPlot⁡X,range=−2..2
DensityPlot⁡XY,range=−2..2,color=Niagara Red
f≔x↦piecewise⁡−1<x<1,3⋅x22,0
f≔x↦3⋅x22−1<x<10otherwise
F≔Distribution⁡PDF=f:
Z≔RandomVariable⁡F:
DensityPlot⁡Z,range=−2..2,thickness=2,color=red,discont=true
DensityPlot⁡Z,range=−2..2,thickness=2,color=red,discont=false
Plot options such as background color or gridlines are passed to the plots:-display command:
DensityPlot⁡GeometricDistribution⁡13,background=LightGrey,gridlines
The Statistics[DensityPlot] command was updated in Maple 2017.
The discont option was introduced in Maple 2017.
For more information on Maple 2017 changes, see Updates in Maple 2017.
See Also
plots[densityplot]
Statistics/Computation
Download Help Document