This function plots as many as three probability density functions and cumulative distribution functions on the same graph using just one command, where the domain of the graph need not be specified by the user.

1 2 3 4 |

`distA` |
Character variable naming the first probability density function (starting with "d") or cumulative density function (starting with "p") to be graphed. |

`parmA1` |
The first argument in |

`parmA2` |
The second argument in |

`distB` |
Character variable naming the second probability density function (starting with "d") or cumulative density function (starting with "p") to be graphed. |

`parmB1` |
The first argument in |

`parmB2` |
The second argument in |

`distC` |
Character variable naming the third probability density function (starting with "d") or cumulative density function (starting with "p") to be graphed. |

`parmC1` |
The first argument in |

`parmC2` |
The second argument in |

`xlab` |
The label of the |

`xmin` |
The minimum x-value to be graphed. |

`xmax` |
The maximum x-value to be graphed. |

`col` |
A vector specifying the colors of |

`is.discrete` |
A vector with 1, 2, or 3 logical values, indicating whether or not |

`additional.x.range` |
A vector of two additional x-values for evaluating the function. This argument would be needed only if the user is dissatified with the domain determined by the function. |

`lwd` |
The line width for discrete distributions. |

`...` |
Optional arguments to be passed to the |

If only one graph is to be plotted, then use `distA`

.
If only two graphs are to be plotted, then use `distA`

and `distB`

.

The arguments in `plotDist`

are typically entered as first distribution plus two parameters,
second distribution plus two parameters, and third distribution plus two parameters.
If only one parameter of the distribution is needed, then the second parameter can be left as
the default of `NULL`

.
If three or more parameters of the distribution are needed, then the first parameter can be assigned
to be a vector consisting of all of the parameters.

The defaul value of `distA`

is "dnorm"; i.e., for plotting the normal distribution.

The default values of all of the arguments following `parmC2`

usually are sufficient.

This function `plotDist`

calls functions `getMinMax`

,
`plot`

, and `curve`

.

Steven T. Garren, James Madison University, Harrisonburg, Virginia, USA

`shadeDist`

, `plot`

, and
`getMinMax`

1 2 3 4 5 6 7 8 9 | ```
# Plots standard normal density in black, t density with 3 d.f. in red, and
# non-central t density with 3 d.f. and non-centrality parameter=1.4 in green.
plotDist( "dnorm", 0, 1, "dt", 3, 0, "dt", 3, 1.4 )
# Plots normal approximation to Binomial(n=100, p=0.4).
plotDist( , 40, sqrt(100*0.4*0.6), "dbinom", 100, 0.4, col=c("blue", "hotpink") )
# Plots cumulative normal and Cauchy distribution functions.
plotDist( "pnorm", 50, 10, "pcauchy", 50, 10, col=c("purple","orange") )
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.