R作图 Beta Distribution

描述性统计分析的一个实例;贝塔分布

> curve ( dbeta(x, 1, 1), xlim = c(0,1), ylim = c(0,4) )
> curve ( dbeta(x, 3, 1), add = T, col = "green" )
> curve ( dbeta(x, 3, 2), add = T, lty = 2, lwd = 2)
> curve ( dbeta(x, 4, 2), add = T, lty = 2, lwd = 2, col = 'blue' )
> curve ( dbeta(x, 2, 3), add = T, lty = 3, lwd = 3, col = 'red' )
> curve ( dbeta(x, 4, 3), add = T, lty = 3, lwd = 3, col = 'orange' )
> title ( main = "Beta Distribution" )
> legend ( par('usr')[1], par('usr')[4], xjust = 0,
+           c('(1,1)', '(3,1)', '(3,2)', '(4,2)', '(2,3)', '(4,3)'),
+           lwd = c(1, 1, 2, 2, 3, 3),
+           lty = c(1, 1, 2, 2, 3, 3),
+           col = c(par('fg'), 'green', par('fg'), 'blue', 'red', 'orange'))
————————————————————————————————————————————————————————

curve 简介:

http://127.0.0.1:25686/library/graphics/html/curve.html

Description

Draws a curve corresponding to a function over the interval [from, to]. curve can plot also an expression in the variable xname, default x.

Usage

curve(expr, from = NULL, to = NULL, n = 101, add = FALSE,
      type = "l", xname = "x", xlab = xname, ylab = NULL,
      log = NULL, xlim = NULL, ...)

## S3 method for class 'function'
plot(x, y = 0, to = 1, from = y, xlim = NULL, ylab = NULL, ...)

Arguments

expr

The name of a function, or a call or an expression written as a function of x which will evaluate to an object of the same length as x.

x

a ‘vectorizing’ numeric R function.

y

alias for from for compatibility with plot

from, to

the range over which the function will be plotted.

n

integer; the number of x values at which to evaluate.

add

logical; if TRUE add to an already existing plot; if NA start a new plot taking the defaults for the limits and log-scaling of the x-axis from the previous plot. Taken as FALSE (with a warning if a different value is supplied) if no graphics device is open.

xlim

NULL or a numeric vector of length 2; if non-NULL it provides the defaults for c(from, to) and, unless add = TRUE, selects the x-limits of the plot – see plot.window.

type

plot type: see plot.default.

xname

character string giving the name to be used for the x axis.

xlab, ylab, log, ...

labels and graphical parameters can also be specified as arguments. See ‘Details’ for the interpretation of the default for log.

For the "function" method of plot, ... can include any of the other arguments of curve, except expr.

转载于:https://www.cnblogs.com/bangemantou/archive/2012/12/26/2834744.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值