DensityPlot - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


Statistics

  

DensityPlot

  

plot the density of a random variable

 

Calling Sequence

Parameters

Description

Options

Examples

Compatibility

Calling Sequence

DensityPlot(X, options, plotoptions)

DensityPlot['interactive'](X)

Parameters

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

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.

• 

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.

Examples

withStatistics:

XRandomVariableNormal0,1

X_R

(1)

YRandomVariableNormal0,1

Y_R0

(2)

DensityPlotX,range=2..2

DensityPlotXY,range=2..2,color=Niagara Red

fxpiecewise−1<x<1&comma;3x22&comma;0

fx3x22−1<x<10otherwise

(3)

FDistributionPDF=f&colon;

ZRandomVariableF&colon;

DensityPlotZ&comma;range=2..2&comma;thickness=2&comma;color=red&comma;discont=true

DensityPlotZ&comma;range=2..2&comma;thickness=2&comma;color=red&comma;discont=false

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

DensityPlotGeometricDistribution13&comma;background=LightGrey&comma;gridlines

Compatibility

• 

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

Statistics/Computation